Dankland Playground Moneymaker - V2โversion 2โ of my playground bot script. Its essentially a powerhouse suite of strategies. Although it is similar to the previous script, it nets different results as sections have been changed. Such as the somewhat reluctant removal of the Chande Momentum... The RSIs have also been updated, this was one of the main changes. RSIS now include a Moving Average cross of RSI to generate signals above and below the given thresholds instead of simply on crossing a threshold. This should give greater functionality overall. Most functions including Moving Averages have been updated to include a wider range of kinds of moving averages. This includes not just the moving average cross, but MACD and RSIs as well. I tried to perform the same upgrade on the %B, Stochastics and SMI, but hit the unpacked code limit of 60,000 lines... So, more โversionsโ will have to come for future โupgradesโ, with the recognition that there will be cases where the old, โdowngradedโ versions may perform better and that some people (like myself) may continue to use them on some markets until I/we devise superior settings on the new ones for said markets. For instance, instead of replacing my 1 hr BTCUSD bot (where I used the now deleted Chande to pretty pleasing affect...) I made a new one for LINKUSD 10 min so I can have both running for now and work on replacing the BTCUSD later.
How it works basically is this... you have 16 oscillators which can all be used as independently as you wish. They can be split up into different groups or ran all together.
When in separate groups they should not be able to sell eachothers positions without triggering a full stop loss by turning the Independence/Stop All switches on. Every single oscillator has its own entry and exit position sizing which can be stated as either a percent of balance or a flat amount of contracts (or both combined). Each oscillator has a minimum amount of profit you can tell it to sell it, which is calculated from the average cost of your current position, which does include all groups. This works out to help you average out better entry and exit prices, essentially a method of DCAing.
You can set the minimum sale amount, which is to keep it from placing orders below your exchanges minimum dollar trade cost.
All this functionality combined also ensures more accurate back tests by ensuring that the script simply cannot spend money it doesn't see as in the balance, whereas other scripts will use a percentage of equity, and once 100% of your equity is in BTC for instance, it will keep buying more BTC for free and thus spoof up backtest numbers. If you look through the strategies here, many people claim to have amazing scripts and then you look into it and this is happening and skewing their numbers. These people are either very ignorant or what they made or scam artists and trolls in my opinion.
This version also includes On Bar Close switches for each oscillator. When switched on, signals are only allowed to generate on Bar Close. This helps to prevent retriggering from live signals, which when you are running this many oscillators, will become a problem! However, in most cases, you do not need to generate signals intrabar, as backtests will show, ignoring intrabar buys and sells (intrabar stop losses can still be very important though!) won't exactly keep you from high profitability strategies, but rather, allowing elements of chaos from live indicators moving up and down intrabar will, in fact, drift your actual results further and further from the backtest. You want an accurate backtest though. So choose wisely when you turn these off and you will do better.
The included oscillators are as follows:
NO MORE Chande Momentum cross โ REMOVED โ I was hitting PINE code limits here so I had to make choices and this one simply had to go. Begone!
Moving Average Cross
MACDย cross
%Bย Bollingerย cross
Stochasticย cross + region filter
Stochastic RSIย cross + region filter
SMII cross and region filter
Three RMIs
Know-Sure-Thing line-cross
Coppock Curve line-cross
TRIX line-cross
RSI of MA w/ MA cross
RSI of MA of KST w/ MA cross
RSI of MA of Coppock Curve w/ MA cross
RSI of MA of Trix w/ MA cross
So the idea is that this is essentially multiple strategies combined into one backtestable house. Balance is calculated for all position sizes in order to try to prevent false entries that plague so many scripts (IE, you set pyramiding to 2, each buy $1000, initial balance $1000, and yet it buys two orders off the bat for $2000 total and nets 400% profit because the second was considered free, happens on 90+% of scripts on Tradingview if you aren't very very careful!)
You tune each indicator and position size them so that they work together as well as you can and in doing so you are able to create a single backtest that is capable of running a bot, essentially, between multiple strategies - you can run a slower Moving Average cross, a faster SMI cross orย MACDย , orย Bollingerย that grabs big moves only, all the while havingย MACDย trade small bonuses along the way. This way you can weight the Risk to Reward of each against eachother.
I will not try to claim this is something you can open and with no work have the best bot on the planet. This scripts intention is to take a lot of relatively common trading strategies and combine them under on roof with some risk management and the ability to weigh each against eachother.
If you are looking for a superย advancedย singular algorithm that tries to capture every peak and valley exactly on the dot, this is not for you. If you are looking for a tool with a high level of customizability, with a publisher who intends to update it to the best of his ability in accordance to seeking to make the best product that I personally can make for both myself and the community (because I will be using this myself of course!) that was specifically designed with the intention of performing well in spot markets by averaging low entry costs and high exit costs, this is for you! That is the exact intention here. It can certainly work with margin, but you will have to take extra care in setting your stop losses. I intend to make a version capable of going short which will be included as part of the package. It may take some work to keep all of the risk management working as well for shorts though. There will be more scripts added to the โpackageโ as I hit the limit on this one a few times and have had to keep some ideas out already.
The current backtest shown is hand-optimized by myself forย Linkย /USD 10min market (Binance US โ shouldn't need much work to fit to other exchange markets) with multiple stop losses.
Search in scripts for "stop loss"
(IK) Base Break BuyThis strategy first calculates areas of support (bases), and then enters trades if that support is broken. The idea is to profit off of retracement. Dollar-cost-averaging safety orders are key here. This strategy takes into account a .1% commission, and tests are done with an initial capital of 100.00 USD. This only goes long.
The strategy is highly customizable. I've set the default values to suit ETH/USD 15m. If you're trading this on another ticker or timeframe, make sure to play around with the settings. There is an explanation of each input in the script comments. I found this to be profitable across most 'common sense' values for settings, but tweaking led to some pretty promising results. I leaned more towards high risk/high trade volume.
Always remember though: historical performance is no guarantee of future behavior . Keep settings within your personal risk tolerance, even if it promises better profit. Anyone can write a 100% profitable script if they assume price always eventually goes up.
Check the script comments for more details, but, briefly, you can customize:
-How many bases to keep track of at once
-How those bases are calculated
-What defines a 'base break'
-Order amounts
-Safety order count
-Stop loss
Here's the basic algorithm:
-Identify support.
--Have previous candles found bottoms in the same area of the current candle bottom?
--Is this support unique enough from other areas of support?
-Determine if support is broken.
--Has the price crossed under support quickly and with certainty?
-Enter trade with a percentage of initial capital.
-Execute safety orders if price continues to drop.
-Exit trade at profit target or stop loss.
Take profit is dynamic and calculated on order entry. The bigger the 'break', the higher your take profit percentage. This target percentage is based on average position size, so as safety orders are filled, and average position size comes down, the target profit becomes easier to reach.
Stop loss can be calculated one of two ways, either a static level based on initial entry, or a dynamic level based on average position size. If you use the latter (default), be aware, your real losses will be greater than your stated stop loss percentage . For example:
-stop loss = 15%, capital = 100.00, safety order threshold = 10%
-you buy $50 worth of shares at $1 - price average is $1
-you safety $25 worth of shares at $0.9 - price average is $0.966
-you safety $25 worth of shares at $0.8. - price average is $0.925
-you get stopped out at 0.925 * (1-.15) = $0.78625, and you're left with $78.62.
This is a realized loss of ~21.4% with a stop loss set to 15%. The larger your safety order threshold, the larger your real loss in comparison to your stop loss percentage, and vice versa.
Indicator plots show the calculated bases in white. The closest base below price is yellow. If that base is broken, it turns purple. Once a trade is entered, profit target is shown in silver and stop loss in red.
BBofVWAP with entry at Pivot PointThis strategy uses BB of VWAP and Pivot point to enter and exit the Long position.
settings
BB length 50
BB Source VWAP
Entry
When VWAP crossing up BB midline and price/close is above weekly PivotPoint ( you can also use Daily pivot point )
Exit
When VWAP is crossing down BB lower band
Stop Loss
Stop loss defaulted to 5%
Note : Long will position will be exited on either VWAP crossing down BB lower band or stop loss is hit - whichever comes first . Being said that some time your stop loss exit is less than 5% which saves from more losses.
Entry is based on weekly Pivot point , so any time frame below weekly will work perfect. I have tested t on 30 min , 1 HR , 4 Hr , Daily charts. Even weekly setting shows good results , that will work for long term investing style.
if you change Pivot period to Daily , chose time frames below Daily.
I also noticed this strategy mostly do not enter Long position in a down trend. Even it finds one , it will be exited with minimal loss.
Warning
For the use of educational purposes only
Backtest PREMIUM Suite+ (Plug & Play)Hello traders
I. ๐ SCRIPTS ACCESS AND TRIALS ๐
1. For the trial request access, they have to be done through my website .
2. My website URL is in this script signature at the very bottom (you'll have to scroll down a bit and going past the long description) and in my profile status available here : Daveatt
Due to the new scripts publishing house rules, I won't mention the URL here directly. As I value my partnership with TradingView very much, I prefer showing you the way for finding them :)
3. Many video tutorials explaining clearly how all our indicators work are available on our website > guides section.
4. You may also contact me directly for more information
II. ๐ Backtest PREMIUM Suite+ (Plug & Play) ๐
2.1 Forewords
This indicator is available only to our PREMIUM 12 months users. YES! I said indicator, and not strategy or backtest for an excellent reason.
We wanted to make it as generic as possible and allow anyone to connect any indicator of his/her choice in a few clicks only.
This is NOT possible (in TradingView) with a strategy/backtest, but only with an indicator - that's why we worked on recoding the whole backtest logic as an indicator.
The PRO edition does not handle any pyramiding/re-entry - as such enters only once per trend by design. This feature is reserved for our PREMIUM users.
2.2 Concept
This is an indicator that I saw on TradingView and was introduced by the @Pinecoders account on TradingView.
I inspired myself from his Backtest Engine to offer a version more adapted to my vision - The benefits of connecting yourself any indicator to our Backtest engine are amazing and huge.
The concept can't be more simple. Imagine using any indicator and connecting to a backtest system in a single click.
You may connect your Algorithm Builder also to this complete backtesting system in a single click.
What's better between paying thousands for each backtest, or connecting yourself your indicators to your backtest with a click?
That was a rhetoric question, but you can still share your answer with me if you want to :)
III. The amazing benefits of our๐&๐น๏ธ (Plug&Play) system
Issue #1 ๐ฒ A BACKTEST SYSTEM IS COSTLY ๐ฒ
Hiring a developer to code a custom indicator is costly. For a custom backtest it's even more expensive as those scripts are very often way more complicated.
Now imagine, that now that you see your idea live on a chart, you'll realize you'll have to finance another backtest system, as the one you have is not compatible with your new idea.
Solution #1 ๐ฒ๐ฒ YOU COULD BE SAVING SOME MONEY ๐ฒ๐ฒ
just because it won't be needed to hire someone else for each of your trading idea.
We will never guarantee your success on the market, but THIS I stand by it any day any hour.
You can connect any indicator or your choice by updating your indicator slightly and connecting it to our Backtest engine. We send the tutorial for doing it to all our customers.
Issue #2 ๐ IT'S TIME-CONSUMING ๐
Even if someone is doing all the coding for you, it might require days/weeks depending on your overall trading strategy/idea.
Without even counting the time for you to test/validate the work done and all the back-and-forth to fix all the issues.
Solution #2 SAVING TIME MIGHT EQUATES TO SAVING MONEY : ๐ = ๐ฒ๐ฒ๐ฒ
I wish it could be as easy as going from weeks of coding to "1 single click" :)
I did the heavy-lifting, but you'll have to make the last effort the cross the finishing line. I made it easy for you to play with it and find a configuration that makes sense to YOU and for your strategy/asset/timeframe
Issue #3 โ IT'S COMPLICATED โ
Someone did a backtest code for you, but... you can't update it because you either :
- don't know anything in programming
- ... and don't have time to learn (most of us have a job/family/...life)
- The system you have is way too specific for one of your previous idea, but can't be updated easily for your next trading ideas. I see a lot of traders nodding right now thinking "that's soooooo true !!!!"
Solution #3 ๐ WE MADE IT EASY AND FUN ๐
Our goal is to externalize the technical stuff that you don't want to take care of - so that you can finally focus on your trading and optimizing your ideas. #bold #statement
In case you're wondering, no we're not reading your mind :), but we're also traders who didn't know how to code before and had to hire external programmers to do the heavy work for us.
You can be sure that most of the frustrations (trading, technical, ...) you have/had, we had them also and that's why we created this backtest indicator.
III. ๐&๐น๏ธ
Hope you're ready to be impressed. Because, what I'm about to introduce, is my best-seller feature - and available across many of my indicators.
In TradingView, there is a feature called "Indicator on Indicator" meaning you can use an external indicator as a data source for another indicator.
I'm using that feature to connect any external indicator to our Backtest PREMIUM Suite+ (Plug & Play) - hence the plug and play name. Please don't make it a plug and pray :) it's supposed to help you out, not to stress you even more
Let's assume you want to connect your Algorithm Builder Multiple Trends+ to your Backtest PREMIUM Suite+
I mentioned an Algorithm Builder but you may connect any oscillator (MACD, On balance volume, stochastic RSI, True Strenght index, and many more..) or non-oscillator (divergence, trendline break, higher highs/lower lows, candlesticks pattern, price action, harmonic patterns, ...) indicators.
THE SKY IS (or more likely your imagination) is the limit :)
Fear no more. The Plug&Play technology allows you to connect it and use it the backtest calculations.
This is not magic, neither is sorcery, but certainly is way beyond the most awesome thing I've ever developed on TradingView (even across all brokers I know). #bolder #statement
TradingView is the best trading platform by far and I'm very grateful to offer my indicators on their website.
To connect your external indicator to ours, we're using a native TradingView feature, which is not available for all users.
It depends on your TradingView subscription plan ( More info here )
If you intend to use our Algorithm Plug&Play indicator, and/or our Backtest Plug&Play suites, then you must upgrade your TradingView account to enjoy those features.
We value our relationship with our customers seriously, and that's why we're warning you that a compatible TradingView account type is required - at least PRO+ or PREMIUM to add more than 1 Plug&Play indicator per account.
We go in-depth on our website why the Plug&Play is an untapped opportunity for many traders out there - URL available on my profile status and signature
IV. ๐ Make it nice! ๐
Now we're getting right into the fun stuff.
Let's explore briefly each display option (symbolized by an ๐๏ธโ๐จ๏ธ in the Backtest UI) :
- Color Traded Background : Color the chart background is green when in a BUY trade, in red when in a SELL trade. If the Backtest is not in a trade, then the background won't be colored.
- Show Entry/Exit Markers : Displays the entries (Enter Long/Enter Short), and exits (Exit Long/Exit Short) labels.
- Show Entry Level : Displays a blue level line to easily identify the entry price of a trade.
- Show Take Profit Level : Display a purple line to visualize where the Take Profit level is (we'll explain below how to set it up).
- Show In-Trade Stops : Display the stop-loss
V. Backtesting filters
A backtest should have some filters helping the traders testing a few hypotheses. Well.... we included a ton of them.
Once again, thank you @Pinecoders for the help and support you gave me
5.1 โ Trade Direction โ
- Both: The backtest takes the BUY, and SELL trades.
- Longs only/Short only: To be used if the trader wants to take the trades in a unique direction only
5.2 โฒ๐ทPyramiding๐ทโผ
The Backtest PRO allows 1 entry per identified trend
Pyramiding has many names such as Re-entry, secondary trend, Additional entry, ...
Basically, it refers to entering multiple times in the same trend.
Maximum Number of Pyramiding Entries: Literally the max number of re-entries in the same trend.
For instance, if set to 2, then depending on the signals, you'll get at most 2 re-entries in the same trade direction.
- Position Size Multiple of Original Entry Position: Option to add X multiples of the original position size for the re-entries.
Example: Position size multiple = 2, and First entry size is $100. Then, the re-entries position sizes will be ($100 X 2 = $200).
5.3 โ โ Position sizing โ โ
- 1. % of Equity: If selected, the position size used is the input to the right of 1. % of Equity.
Example: The trader starts with a capital of 100K. After a winning trade, your total capital is $103K - for the next trade the position size will be 3% of $103K
- 2. % of Capital: If selected, the position size used is the input to the right of 2. % of Capital.
In other words, the position size will always be the same position size as calculated on the initial capital.
Example: The trader starts with a capital of 100K. After a winning trade, your total capital is $103K - for the next trade the position size will be 5% of $100K. (As 100K is the initial capital used in our dummy example)
5.4โ Entry Stops and In-Trade Stops โ
We didn't reinvent the wheel here. Any good backtest should offer an entry stop-loss and an in-trade stop-loss.
Giving only here also an example among all the use cases. For instance, the trader sets a stop-loss 2% at the time of entry on your trade, but once the trade moves in the desired direction, the trader might want a trailing stop-loss using a 4% input.
Example: A trader goes LONG on only 1 "ABC" stock evaluated $10 per share.
1) The entry-stop loss will be 2% away so set at $8
2) A candle
3) The trailing stop will activate, and move the stop-loss from the entry stop-loss level (=$8) to $8.32 (=4% move up from $8) - and so on, and so forth for each time the price moves 4% up
The entry and in-trade stop losses can absolutely be identicals. There is no universal rule, and as always you know the drill - all depends on your backtest, and trading strategy as a whole.
5.5 โ Hard Exits โ
โ ๏ธThe Backtest PRO Suite offers the hard exit on MACD only.
Our Backtest PREMIUM Suite offers 2 more indicators to invalidate your trades on :
1. MACD
2. Trend Direction
3. RSI divergence (Regular, and Hidden)
The hard exit (or invalidation) is a fundamental part of my trading method.
I explained numerous times on TradingView, our website, and social media channels why I "love" this concept so much, and how it saved my trading account numerous times from getting savagely wrecked by the market.
5.6 ๐ฒ๐ฒ Take Profit ๐ฒ๐ฒ
We only included 1 level of Take Profit so far. We'll work on adding at least one more soon.
You can set your Take Profit level based on either a:
1- Fixed value
2 - Percentage value
5.7 ๐ Date Range Filtering ๐
If enabled, the backtest only uses the data between the starting and the ending dates of the defined range.
5.8 โฑ๏ธ Hourly Range Filtering โฑ๏ธ
Please note that the hours filtering is based on the broker time - not on your chart time.
In other words, if your chart is UTC+1, but you're trading an asset from a US EAST COAST broker, then the timezone used is the UTC-4 timezone.
You'll must be wary of this when filtering and probably do a quick (but simple) calculation before setting up this option.
The easiest would be to set your chart timezone on the broker local timezone (and no math is needed).
Let's add a quick note that the hourly filter is also included in our Algorithm Builders PRO/PREMIUM 12 months. #shameless #self #advertising
5.9 โโ Fees and Slippage โโ
Too often completely ignored by many traders, the fees can eat gains out quickly/deepen one's capital faster than expected.
โ ๏ธThe fees vary between brokers, and asset traded - it could be recommended to check on your broker page what are the fees for the asset on your chart, and insert that percentage number.
Another cost ignored, even more, is the Slippage.
i.e. think about a Stop-Loss being hit, and we're so confused because we see on the chart that NEVER the price came even close to your SL level, but... it got hit anyway.
Yes! we know how frustrating it is, but that's the game we're playing, and trading should never be about blaming the game, but only blaming the players/traders/ourselves.
Blaming the game constantly is likely to not end with good performance results, but accounting for this "risk", and being able to quantify it is an incredible hedge. #bold #statement #level #10000
5.10 ๐ Alerts ๐
By design, the alerts aren't available for strategy scripts. But this script is an... indicator so why should we not enjoy all the cards in our hands the fullest.
We enabled the alerts on the:
1. Main BUY/SELL Entry
2. Pyramiding BUY/SELL Entries
3. Exit Signals such as stop-loss, take-profit, hard-exits
You're welcome :)
VI. ๐ Where are the backtest results? ๐
Answer: in the Data Window section of your TradingView
Now the cherry on the cake if we might say so. A backtest is cool, but visualizing results is actually the end goal here.
Our PREMIUM users benefit from way more analytics than the PRO users.
More info available on our website.
The Data Window is dynamic - it means whenever you'll mouseover at a give time on your chart, the data on that panel automatically updates.
Let's assume you're backtesting your idea between Sept 1st, 2019, and Oct 1st, 2019.
If your mouse cursor is located (or hovered) at a candle on Sept 14th, 2019 (data chosen randomly for this example), then the data displayed only includes the results between Sept 1st, and Sept 14th.
More info available on our website with a nice tutorial video. Data window metrics and filters explained on our website
Here's what the data window looks like: imgur.com
If you have any doubt or question, please hit me up directly or ask in the comments section of this script.
I'll never claim I have the best trading methodology or the best indicators.
You only will judge and I'll appreciate all the questions and feedback you're sending my way.
They help me a ton to develop indicators based on all the requests I received.
Kind regards,
Dave
Strategy Builder Crypto V6Hello everyone
This indicator is the result of 7 years of trading (including 3 years of analyzing day and night how crypto assets behave).
I made it fully customizable but I wouldn't recommend changing the default values as they're the most optimal ones for now. Might change in the future but I'm very happy with the signals so far and I hope you'll be as well :)
Without further due, let's dig into it...
0 - Algo trading and Why
In the crypto trading, there is a lot of useless noise (we can probably thank Crypto Twitter for that :p) and a lot of useless data with the sole purpose is to lure you (who said Bitfinex Long/Short ratio or CME gaps ??)
I wanted to remove all the useless and only focus on Technical Analysis (TA) because I was deeply convinced that TA includes by design Fundamental Analysis (FA) and Pumponomics Analysis (PA) - PA being for instance when your favorite twitter guru will pump and dump on you
I heard that so many people got REKT from the previous bear market and I wanted to give back to the community - who helped me so much a few years back.
I worked hard to design the method and make it simple for the public and for FREE (so far as I want to collect feedbacks from the community and improving the indicator)
THIS IS MY GIFT TO YOU
1 - Input values
I'll explain later on through a medium article what each parameter means and how to set them up. For now, please used the optimized and recommended values already set in the indicator
2 - The method
This method works for intraday trading for timeframes between m5 and H1. Any timeframe above could work but would give signals too late - in this case, I would recommend changing the inputs with smaller values to adjust
I see a trend being composed of a main trend, and mini sub trends. In other words, for instance, a weekly bullish trend is made of smaller H4 bullish trends. Hope it makes sense so far
Let's call the weekly trend the MAIN trend and the H4 smaller trends the SECONDARY trends
That's exactly what this indicator is about
It will catch the best MAIN trend and all the SECONDARY trends in the same direction of the MAIN trend.
It's up to you if you want to take all the SECONDARY trends or only the first one in the sequence.
3 - Invalidation signal
A signal invalidation is used to make you exiting your position with a small loss before your stop loss will get hit. Very powerful way to save your capital and limit your losses.
You'll find the indicator here on tradingview for free under the name Trend signal with Alert (made by myself)
Trend signal with Alert
to invalidate entries. You'll need to request an invite
Briefly, let's assume we get a BUY signal. I would exit the position either if I'm getting a DOWN trend signal. It means, if the oblique/logarithmic trendline is broken, then it's better to exit the position and wait for the indicator to give another BUY signal later hopefully
Best case, it will limit your loss in case the asset will dump.
Worst case, this strict management strategy will make you exiting your position for no reason and you'll re-enter later (with a signal) at almost the same price or a bit higher
In the long run, this method will prevent you from having big losses
4 - Stop Loss and Take profits levels
It's really up to you. It depends of your capital and psychology
This indicator is made to give big moves but that's not 100% guaranteed. You can draw some trendlines or use moving averages in big timeframes to set your take profit and stop loss levels.
I personally use this also, along with fibonacci on the weekly/monthly timeframes for my take profit levels
As I'm a nice person, I'm linking the Fibonacci indicator that I use here
Automatic Multi-timeframes fibonacci zones
. You'll also need to request an invite for that one
4-bis - Trailing stop
Not financial advice but I use a supertrend and I have a software that will trail my stop according to that supertrend level
For LONG positions, we could set the trailing below the supertrend.
For SHORT positions, we could set the trailing above the supertrend.
You'll find the indicator here on tradingview for free under the name Supertrend V1.0 - Buy or Sell Signal
5 - Which assets
It's working with the default values on major/mid/small caps and for ALTS/BTC, ALTS/USD and ALTS/ETH pairing
YES, THIS IS MOST AWESOME THING OF THE ENTIRE UNIVERSE !!!
6 - Best setup
m15 timeframe is my preferred one for this method. Best Risk/Reward/Invalidations ratio among all other timeframes
I strongly recommend to use the Trend Signal with the input value 14 for the invalidations
If you enter on a BUY signal, and get a RED trend signal, exit immediately the position without waiting for any other confirmation/pullback or anything else
If you enter on a SELL signal, and get a BLUE trend signal, exit immediately the position without waiting for any other confirmation/pullback or anything else
For the trailing stop/Supertrend value, it depends of your capital and how big your stop loss should be. I personally use the settings in the Supertrend indicator
7 - Alerts
You can setup alerts for the primary and secondary signals in Tradingview so that you won't have to stare at the charts all day long. You mental healthy is my priority above everything else :)
8 - More to come
I personally use the alerts from this indicator coupled with a system to take the trades given by the tradingview alerts. I'll publish it later on if I feel the indicator collects enough interest from you guys
Ghost Scalp Protocol By [@Ash_TheTrader]
# ๐ป GHOST SCALP PROTOCOL
### ๐ Stop Getting Trapped. Start Tracking the Banks.
Most retail traders lose because they enter exactly where institutions are exiting. They get caught in **"Stop Hunts"** and **"Fake-Outs."**
The **Ghost Scalp Protocol** is not just an indicator; it is a complete institutional trading system designed for **M1 & M5 Scalpers**. It combines **Smart Money Concepts (SMC)** with a **Physics-Based Momentum Engine ($p=mv$)** to detect high-probability reversals.
---
### โ๏ธ THE LOGIC: 3-STAGE CONFIRMATION
This algorithm does not rely on lagging indicators. It uses a 3-step "Protocol" to validate every trade:
**1. THE GHOST TRAP (Liquidity Sweeps)**
* The script automatically draws "Ghost Lines" at key Swing Highs/Lows where retail Stop Losses are hiding.
* It waits for price to **sweep** these levels (Stop Hunt).
* **The Signal:** A Neon **Skull (โ ๏ธ)** appears *only* if price aggressively rejects the level with high volume. This is the "Turtle Soup" pattern.
**2. THE PHYSICS ENGINE ($p = mv$)**
* Momentum is not just price speed; it is **Mass (Volume) x Velocity (Range)**.
* The dashboard calculates the "Force" of every candle.
* **The Signal:** An **Arrow (โฌ/โฌ)** appears when momentum surges **5x** above the average. This confirms the banks are pushing the move.
**3. BANK BIAS (Elasticity Filter)**
* Markets move like a rubber band.
* The script calculates a hidden "Fair Value" baseline.
* It creates a **Bias**: It only looks for Shorts in **PREMIUM (Shorting)** zones and Longs in **DISCOUNT (Accumulating)** zones.
---
### ๐ THE SMART DASHBOARD (HUD)
A futuristic, non-intrusive Heads-Up Display keeps you focused on the data that matters:
* **๐ฆ BANK BIAS:** Tells you if Institutions are likely **Accumulating** or **Shorting**.
* **๐ HTF TREND:** Automatically checks the **1-Hour Trend**. Don't fight the tide.
* **๐ MOMENTUM:** Real-time Physics calculation.
* **Green Text:** Acceleration (Move is getting stronger).
* **Red Text:** Deceleration (Move is dying).
* **๐ SESSION:** Shows active Bank Sessions (Tokyo, London, NY).
* **โ ๏ธ OVERLAP ALERT:** Flashes GOLD when London & New York are open simultaneously (Peak Volatility).
---
### ๐ฅ STRATEGY: HOW TO TRADE
Use this checklist to execute high-probability scalps:
#### ๐ SHORT SETUP (SELL)
1. **Liquidity:** Wait for price to break above a **Red Ghost Line** (Sweep Highs).
2. **Signal:** Wait for the **Pink Skull โ ๏ธ** (Trap Detected).
3. **Confluence:**
* Dashboard Bias says: **"SHORTING"**
* HTF Trend says: **"BEARISH ๐"** (Optional but recommended).
4. **Entry:** On the Close of the Skull candle.
5. **Stop Loss:** Just above the wick swing high.
#### ๐ LONG SETUP (BUY)
1. **Liquidity:** Wait for price to break below a **Blue Ghost Line** (Sweep Lows).
2. **Signal:** Wait for the **Blue Skull โ ๏ธ** (Trap Detected).
3. **Confluence:**
* Dashboard Bias says: **"ACCUMULATING"**
* HTF Trend says: **"BULLISH ๐"** (Optional but recommended).
4. **Entry:** On the Close of the Skull candle.
5. **Stop Loss:** Just below the wick swing low.
---
### ๐ RECOMMENDED PAIRS & TIMEFRAMES
* **โก Best Timeframes:**
* **1 Minute (M1):** For aggressive "Sniper" entries (High Frequency).
* **5 Minute (M5):** The "Gold Standard" for balanced Scalping.
* **15 Minute (M15):** Safer, higher win-rate Day Trading.
* **๐ Best Assets:**
* **Gold (XAUUSD):** Highly effective on liquidity sweeps.
* **Indices:** US100 (Nasdaq), US30 (Dow Jones).
* **Crypto:** BTCUSD, ETHUSD (High volatility).
* **Forex:** GBPUSD, EURUSD (London/NY Session).
---
### ๐ ๏ธ SETTINGS & CUSTOMIZATION
* **Surge Factor:** Default is **5.0x**. Lower this to 3.0 if you want more aggressive Momentum Arrows.
* **Smart Sessions:** Automatically converts to **New York Time** (EST) regardless of your location. No more time zone math.
* **Visuals:** Designed with "Ghost Glow" technologyโ97% transparent backgrounds that look classy and don't clutter your chart.
---
**"The Ghost Algo sees what you can't."**
*Trade Safe. Trade Smart.*
**~ Ash_TheTrader**
ORB Algoโก ORB Strategy + Backtesting (Pine Script v5)
This script implements a complete Opening Range Breakout (ORB) strategy, featuring built-in backtesting, advanced TP/SL visualization, full style customization, and a performance dashboard. It is designed for traders who want to clearly evaluate breakout performance directly on the chart.
๐ ORB Window Configuration
๐น Session selection: choose between Market Timezone or Custom Session.
๐น Timezone support: configurable from UTC-8 to UTC+12.
๐น Daily limit: option to allow only one trade per day.
๐น Risk/Reward (RR) settings:
Configurable TP1, TP2, and TP3 levels.
Stop Loss calculated dynamically from the ORB range.
๐ Backtesting Engine
๐น Interactive dashboard showing trades, wins, losses, and win rate.
๐น Adjustable partial exits for each TP (TP1, TP2, TP3).
๐น Automatic calculation of percentage-based profit and loss.
๐น Tracks total trades, total profit, and average profit per trade.
๐จ Visual Customization
๐น Fully customizable colors:
ORB high/low lines and range fill.
Buy/Sell entry labels.
TP and SL lines with background zones.
๐น Line style and thickness options (solid, dotted, dashed).
๐น Visibility controls for each TP/SL level.
๐น Clear profit and loss zones drawn directly on the chart.
๐ Trading Logic
๐น LONG entries: triggered when price breaks above the ORB high.
๐น SHORT entries: triggered when price breaks below the ORB low.
๐น Automatic calculation of Stop Loss and TP1, TP2, TP3 based on ORB range and RR.
๐น Customizable BUY / SELL labels displayed at entry.
โ
TP / SL Detection
๐น Real-time detection of TP1, TP2, TP3, and SL hits.
๐น Prevents double counting of the same level.
๐น Extended TP/SL lines with shaded zones for better clarity.
๐ Backtesting Dashboard
๐น Displayed in the top-right corner of the chart.
๐น Shows:
Total trades
Wins / Losses
Win rate (%)
Total profit (%)
Average profit per trade
๐น Fully customizable panel color.
โจ Summary
This script combines:
Opening Range detection
Breakout trading logic with advanced risk management
Professional-grade visualizations
Integrated historical performance tracking
High customization for sessions, styles, and colors
๐ก Ideal for traders who want to trade ORB setups with clarity, structure, and measurable results.
ORB Strategy + Backtesting (fixed timestamp) - Lines Adjustedโก ORB Strategy + Backtesting (Pine Script v5)
This script implements a complete Opening Range Breakout (ORB) strategy, featuring built-in backtesting, advanced TP/SL visualization, full style customization, and a performance dashboard. It is designed for traders who want to clearly evaluate breakout performance directly on the chart.
๐ ORB Window Configuration
๐น Session selection: choose between Market Timezone or Custom Session.
๐น Timezone support: configurable from UTC-8 to UTC+12.
๐น Daily limit: option to allow only one trade per day.
๐น Risk/Reward (RR) settings:
Configurable TP1, TP2, and TP3 levels.
Stop Loss calculated dynamically from the ORB range.
๐ Backtesting Engine
๐น Interactive dashboard showing trades, wins, losses, and win rate.
๐น Adjustable partial exits for each TP (TP1, TP2, TP3).
๐น Automatic calculation of percentage-based profit and loss.
๐น Tracks total trades, total profit, and average profit per trade.
๐จ Visual Customization
๐น Fully customizable colors:
ORB high/low lines and range fill.
Buy/Sell entry labels.
TP and SL lines with background zones.
๐น Line style and thickness options (solid, dotted, dashed).
๐น Visibility controls for each TP/SL level.
๐น Clear profit and loss zones drawn directly on the chart.
๐ Trading Logic
๐น LONG entries: triggered when price breaks above the ORB high.
๐น SHORT entries: triggered when price breaks below the ORB low.
๐น Automatic calculation of Stop Loss and TP1, TP2, TP3 based on ORB range and RR.
๐น Customizable BUY / SELL labels displayed at entry.
โ
TP / SL Detection
๐น Real-time detection of TP1, TP2, TP3, and SL hits.
๐น Prevents double counting of the same level.
๐น Extended TP/SL lines with shaded zones for better clarity.
๐ Backtesting Dashboard
๐น Displayed in the top-right corner of the chart.
๐น Shows:
Total trades
Wins / Losses
Win rate (%)
Total profit (%)
Average profit per trade
๐น Fully customizable panel color.
โจ Summary
This script combines:
Opening Range detection
Breakout trading logic with advanced risk management
Professional-grade visualizations
Integrated historical performance tracking
High customization for sessions, styles, and colors
๐ก Ideal for traders who want to trade ORB setups with clarity, structure, and measurable results.
JAM ORB Algoโก ORB Strategy + Backtesting (Pine Script v5)
This script implements a complete Opening Range Breakout (ORB) strategy, featuring built-in backtesting, advanced TP/SL visualization, full style customization, and a performance dashboard. It is designed for traders who want to clearly evaluate breakout performance directly on the chart.
๐ ORB Window Configuration
๐น Session selection: choose between Market Timezone or Custom Session.
๐น Timezone support: configurable from UTC-8 to UTC+12.
๐น Daily limit: option to allow only one trade per day.
๐น Risk/Reward (RR) settings:
Configurable TP1, TP2, and TP3 levels.
Stop Loss calculated dynamically from the ORB range.
๐ Backtesting Engine
๐น Interactive dashboard showing trades, wins, losses, and win rate.
๐น Adjustable partial exits for each TP (TP1, TP2, TP3).
๐น Automatic calculation of percentage-based profit and loss.
๐น Tracks total trades, total profit, and average profit per trade.
๐จ Visual Customization
๐น Fully customizable colors:
ORB high/low lines and range fill.
Buy/Sell entry labels.
TP and SL lines with background zones.
๐น Line style and thickness options (solid, dotted, dashed).
๐น Visibility controls for each TP/SL level.
๐น Clear profit and loss zones drawn directly on the chart.
๐ Trading Logic
๐น LONG entries: triggered when price breaks above the ORB high.
๐น SHORT entries: triggered when price breaks below the ORB low.
๐น Automatic calculation of Stop Loss and TP1, TP2, TP3 based on ORB range and RR.
๐น Customizable BUY / SELL labels displayed at entry.
โ
TP / SL Detection
๐น Real-time detection of TP1, TP2, TP3, and SL hits.
๐น Prevents double counting of the same level.
๐น Extended TP/SL lines with shaded zones for better clarity.
๐ Backtesting Dashboard
๐น Displayed in the top-right corner of the chart.
๐น Shows:
Total trades
Wins / Losses
Win rate (%)
Total profit (%)
Average profit per trade
๐น Fully customizable panel color.
โจ Summary
This script combines:
Opening Range detection
Breakout trading logic with advanced risk management
Professional-grade visualizations
Integrated historical performance tracking
High customization for sessions, styles, and colors
๐ก Ideal for traders who want to trade ORB setups with clarity, structure, and measurable results.
Fibonacci Vision ProFibonacci Precision Signals Pro | Smart Buy & Sell Alerts
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
OVERVIEW
This indicator combines Fibonacci mathematics with advanced signal filtering to deliver precise buy and sell signals. It automatically detects swing structure, calculates the key 0.618 retracement level, and generates signals only when multiple confirmation factors align.
Clean. Accurate. Professional.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
HOW IT WORKS
The script identifies swing highs and lows, then calculates Fibonacci retracement levels automatically. When price interacts with the 0.618 zone and all filters confirm, a signal appears:
โฒ buy โ Long entry opportunity
โผ sell โ Short entry opportunity
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
6-LAYER CONFIRMATION SYSTEM
Every signal must pass through:
Trend Direction Analysis
Fibonacci Level Interaction
EMA Trend Filter (50-period default)
RSI Momentum Validation (14-period default)
Volume Spike Detection
Candlestick Pattern Recognition (Pin bars, Engulfing, Momentum candles)
This multi-layer approach significantly reduces false signals.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
BUILT-IN RISK MANAGEMENT
Every trade includes automatic stop loss and take profit levels:
Stop Loss: 100 pips
Take Profit: 200 pips
Risk-Reward Ratio: 1:2
Adjust these values in settings to match your trading style.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
KEY FEATURES
โ
Automatic Fibonacci calculation โ no manual drawing
โ
Multi-timeframe compatibility โ M15 to Daily
โ
Universal market support โ Forex, Crypto, Stocks, Indices
โ
Clean minimalist signals โ white triangles with text
โ
Customizable filters โ adjust sensitivity to your preference
โ
Built-in alerts โ never miss a signal
โ
No repainting โ signals remain fixed once confirmed
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Swing Detection:
Swing Length โ Controls sensitivity to market structure (default: 10)
Confirmation Bars โ Bars required to confirm signal (default: 1)
Signal Filters:
EMA Trend Filter โ Toggle trend confirmation on/off
EMA Length โ Adjust trend filter period (default: 50)
RSI Filter โ Toggle momentum confirmation on/off
RSI Length โ Adjust momentum period (default: 14)
Volume Filter โ Toggle volume confirmation on/off
Volume Multiplier โ Set volume threshold (default: 1.2x average)
Risk Management:
Stop Loss Pips โ Set your stop loss distance (default: 100)
Take Profit Pips โ Set your profit target (default: 200)
Pip Value โ Adjust for your instrument (0.0001 for most Forex, 0.01 for JPY pairs)
Visuals:
Show Signals โ Toggle signal visibility
Show Cloud โ Toggle Fibonacci zone visibility
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
BEST PRACTICES
Use on H1 or H4 timeframes for optimal results
Trade in direction of the higher timeframe trend
Avoid trading during major news events
Combine with proper position sizing
Always use the built-in stop loss
Be patient โ quality signals over quantity
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
MARKETS SUPPORTED
Forex โ All major, minor, and exotic pairs
Crypto โ BTC, ETH, and altcoins
Stocks โ Any equity on TradingView
Indices โ S&P500, NASDAQ, DAX, FTSE, etc.
Commodities โ Gold, Silver, Oil, etc.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
WHY FIBONACCI?
The 0.618 ratio (Golden Ratio) is observed by traders worldwide. When price retraces to this level, it often:
Reverses direction
Finds support or resistance
Creates high-probability entry opportunities
This script automates the detection of these key moments.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ALERTS INCLUDED
Set up notifications to receive signals on:
Mobile push notifications
Desktop popups
Email alerts
Webhook integrations
Never miss a trading opportunity again.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
WHAT MAKES THIS DIFFERENT
Most indicators give too many signals. This one focuses on quality.
Most indicators clutter your chart. This one keeps it clean.
Most indicators ignore risk management. This one includes it.
Most indicators work on one market. This one works on all.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
DISCLAIMER
This indicator is a trading tool, not financial advice. Trading involves substantial risk of loss. Past performance does not guarantee future results. Always use proper risk management and never trade with money you cannot afford to lose. Test on a demo account before trading live.
ChronoPulse MS-MACD Resonance StrategyChronoPulse MS-MACD Resonance Strategy
A systematic trading strategy that combines higher-timeframe market structure analysis with dual MACD momentum confirmation, ATR-based risk management, and real-time quality assurance monitoring.
Core Principles
The strategy operates on the principle of multi-timeframe confluence, requiring agreement between:
Market structure breaks (CHOCH/BOS) on a higher timeframe
Dual MACD momentum confirmation (classic and crypto-tuned profiles)
Trend alignment via directional EMAs
Volatility and volume filters
Quality score composite threshold
Strategy Components
Market Structure Engine : Detects Break of Structure (BOS) and Change of Character (CHOCH) events using confirmed pivots on a configurable higher timeframe. Default structure timeframe is 240 minutes (4H).
Dual MACD Fusion : Requires agreement between two MACD configurations:
Classic MACD: 12/26/9 (default)
Fusion MACD: 8/21/5 (default, optimized for crypto volatility)
Both must agree on direction before trade execution. This can be disabled to use single MACD confirmation.
Trend Alignment : Uses two EMAs for directional bias:
Directional EMA: 55 periods (default)
Execution Trend Guide: 34 periods (default)
Both must align with trade direction.
ATR Risk Management : All risk parameters are expressed in ATR multiples:
Stop Loss: 1.5 ร ATR (default)
Take Profit: 3.0 ร ATR (default)
Trail Activation: 1.0 ร ATR profit required (default)
Trail Distance: 1.5 ร ATR behind price (default)
Volume Surge Filter : Optional gate requiring current volume to exceed a multiple of the volume SMA. Default threshold is 1.4ร the 20-period volume SMA.
Quality Score Gate : Composite score (0-1) combining:
Structure alignment (0.0-1.0)
Momentum strength (0.0-1.0)
Trend alignment (0.0-1.0)
ATR volatility score (0.0-1.0)
Volume intensity (0.0-1.0)
Default threshold: 0.62. Trades only execute when quality score exceeds this threshold.
Execution Discipline : Trade budgeting system:
Maximum trades per session: 6 (default)
Cooldown bars between entries: 5 (default)
Quality Assurance Console : Real-time monitoring panel displaying:
Structure status (pass/fail)
Momentum confirmation (pass/fail)
Volatility readiness (pass/fail)
Quality score (pass/fail)
Discipline compliance (pass/fail)
Performance metrics (win rate, profit factor)
Net PnL
Certification requires: Win Rate โฅ 40%, Profit Factor โฅ 1.4, Minimum 25 closed trades, and positive net profit.
Integrity Suite : Optional validation panel that audits:
Configuration sanity checks
ATR data readiness
EMA hierarchy validity
Performance realism checks
Strategy Settings
strategy(
title="ChronoPulse MS-MACD Resonance Strategy",
shorttitle="ChronPulse",
overlay=true,
max_labels_count=500,
max_lines_count=500,
initial_capital=100000,
currency=currency.USD,
pyramiding=0,
commission_type=strategy.commission.percent,
commission_value=0.015,
slippage=2,
default_qty_type=strategy.percent_of_equity,
default_qty_value=2.0,
calc_on_order_fills=true,
calc_on_every_tick=true,
process_orders_on_close=true
)
Key Input Parameters
Structure Timeframe : 240 (4H) - Higher timeframe for structure analysis
Structure Pivot Left/Right : 3/3 - Pivot confirmation periods
Structure Break Buffer : 0.15% - Buffer for structure break confirmation
MACD Fast/Slow/Signal : 12/26/9 - Classic MACD parameters
Fusion MACD Fast/Slow/Signal : 8/21/5 - Crypto-tuned MACD parameters
Directional EMA Length : 55 - Primary trend filter
Execution Trend Guide : 34 - Secondary trend filter
ATR Length : 14 - ATR calculation period
ATR Stop Multiplier : 1.5 - Stop loss in ATR units
ATR Target Multiplier : 3.0 - Take profit in ATR units
Trail Activation : 1.0 ATR - Profit required before trailing
Trail Distance : 1.5 ATR - Distance behind price
Volume Threshold : 1.4ร - Volume surge multiplier
Quality Threshold : 0.62 - Minimum quality score (0-1)
Max Trades Per Session : 6 - Daily trade limit
Cooldown Bars : 5 - Bars between entries
Win-Rate Target : 40% - Minimum for QA certification
Profit Factor Target : 1.4 - Minimum for QA certification
Minimum Trades for QA : 25 - Required closed trades
Signal Generation Logic
A trade signal is generated when ALL of the following conditions are met:
Higher timeframe structure shows bullish (CHOCH/BOS) or bearish structure break
Both MACD profiles agree on direction (if fusion enabled)
Price is above both EMAs for longs (below for shorts)
ATR data is ready and above minimum threshold
Volume exceeds threshold ร SMA (if volume gate enabled)
Quality score โฅ quality threshold
Trade budget available (under max trades per day)
Cooldown period satisfied
Risk Management
Stop loss and take profit are set immediately on entry
Trailing stop activates after 1.0 ATR of profit
Trailing stop maintains 1.5 ATR distance behind highest profit point
Position sizing uses 2% of equity per trade (default)
No pyramiding (single position per direction)
Limitations and Considerations
The strategy requires sufficient historical data for higher timeframe structure analysis
Quality gate may filter out many potential trades, reducing trade frequency
Performance metrics are based on historical backtesting and do not guarantee future results
Commission and slippage assumptions (0.015% + 2 ticks) may vary by broker
The strategy is optimized for trending markets with clear structure breaks
Choppy or ranging markets may produce false signals
Crypto markets may require different parameter tuning than traditional assets
Optimization Notes
The strategy includes several parameters that can be tuned for different market conditions:
Quality Threshold : Lower values (0.50-0.60) allow more trades but may reduce average quality. Higher values (0.70+) are more selective but may miss opportunities.
Structure Timeframe : Use 240 (4H) for intraday trading, Daily for swing trading, Weekly for position trading
Volume Gate : Disable for low-liquidity pairs or when volume data is unreliable
Dual MACD Fusion : Disable for mean-reverting markets where single MACD may be more responsive
Trade Discipline : Adjust max trades and cooldown based on your risk tolerance and market volatility
Non-Repainting Guarantee
All higher timeframe data requests use lookahead=barmerge.lookahead_off to prevent repainting. Pivot detection waits for full confirmation before registering structure breaks. All visual elements (tables, labels) update only on closed bars.
Alerts
Three alert conditions are available:
ChronoPulse Long Setup : Fires when all long entry conditions are met
ChronoPulse Short Setup : Fires when all short entry conditions are met
ChronoPulse QA Certification : Fires when Quality Assurance console reaches CERTIFIED status
Configure alerts with "Once Per Bar Close" delivery to match the non-repainting design.
Visual Elements
Structure Labels : CHOCHโ, CHOCHโ, BOSโ, BOSโ markers on structure breaks
Directional EMA : Orange line showing trend bias
Trailing Stop Lines : Green (long) and red (short) trailing stop levels
Dashboard Panel : Real-time status display (structure, MACD, ATR, quality, PnL)
QA Console : Quality assurance monitoring panel
Integrity Suite Panel : Optional validation status display
Recommended Usage
Forward test with paper trading before live deployment
Monitor the QA console until it reaches CERTIFIED status
Adjust parameters based on your specific market and timeframe
Respect the trade discipline limits to avoid over-trading
Review quality scores and adjust threshold if needed
Use appropriate commission and slippage settings for your broker
Technical Implementation
The strategy uses Pine Script v6 with the following key features:
Multi-timeframe data requests with lookahead protection
Confirmed pivot detection for structure analysis
Dynamic trailing stop management
Real-time quality score calculation
Trade budgeting and cooldown enforcement
Comprehensive dashboard and monitoring panels
All source code is open and available for review and modification.
Disclaimer
This script is for educational and informational purposes only. It is not intended as financial, investment, or trading advice. Past performance does not guarantee future results. Trading involves substantial risk of loss and is not suitable for all investors. Always conduct your own research and consult with a qualified financial advisor before making any trading decisions. The author and TradingView are not responsible for any losses incurred from using this strategy.
DCA Ladder CalculatorThis script is a DCA (Dollar-Cost Averaging) Ladder Calculator with Risk & Leverage Management baked in.
Itโs designed for both LONG and SHORT positions, and helps you:
๐ฏ Strategically scale into positions across multiple entry points
๐ Control risk exposure via defined capital allocation
โ๏ธ Utilize leverage responsibly โ for efficiency, not destruction
๐งฎ Visualize risk, stop loss level, and entry distribution
๐ Adapt to trend reversals or key zones, especially when combined with reversal indicators or higher timeframe signals
๐ง How It Works
This tool takes a capital allocation approach to building a ladder of positions:
1. You define:
- Portfolio value
- Risk per trade (as %)
- Leverage
- Number of DCA levels
- Entry multiplier (e.g. 1x, 2x, 4x...)
2. The script then:
- Calculates total margin to risk = Portfolio ร Risk %
- Calculates total leveraged position size = Margin ร Leverage
- Distributes entries according to exponential weights (1x, 2x, 4x...), totaling 7 for 3 levels
- Calculates per-entry:
- Entry price (based on price zone spacing)
- Multiplier
- Exact margin per entry
- Leverage per entry (margin ร leverage)
- Computes:
- Average entry price (margin-weighted)
- Approximate stop loss level based on recent ATR and price structure
- % drawdown to SL
- Total margin and position size
3. Displays all this in a clean on-chart table.
๐ How to Use It
1. Apply the indicator to a chart (default: 1D โ ideal for clean zones).
2. Configure your:
- Portfolio Value (total trading capital)
- Risk per Trade (%) (your acceptable loss)
- Leverage (exchange or strategy-based)
- DCA Levels (e.g. 3 = anchor + 2 entries)
- Multiplier (typically 2.0 for doubling)
3. Choose LONG or SHORT mode depending on direction.
4. The table will show:
- Entry price ladder
- Margin used per entry
- Total position size
- Approx. stop loss (where your full risk is defined)
Use in conjunction with price action, S/R zones, trendline breaks, volume divergence, or reversal indicators.
โ
Best Practices for Using This Tool
- Leverage is a tool, not a weapon. Use it to scale smartly โ not recklessly.
- Use fewer, higher-conviction entries. Donโt blindly ladder; combine with price structure and signals.
- Stick to your risk percent. Never risk more than you can afford to lose. Let this calculator enforce discipline.
- Combine with other confirmation tools, like RSI divergence, momentum shifts, OB zones, etc.
- Avoid martingale-style over-exposure. This is not a gambling tool โ itโs for capital efficiency.
๐ก๏ธ What This Tool Does NOT Do
- This is not a trade signal indicator.
- It does not place trades or auto-manage positions.
- It does not replace personal responsibility or strategy โ it's a tool to help apply structure.
โ ๏ธ Disclaimer
This script is for educational and informational purposes only.
It does not constitute financial advice, nor is it a recommendation to buy or sell any financial instrument.
Always consult a licensed financial advisor before making investment decisions.
Use of leverage involves high risk and can lead to substantial losses.
The author and publisher assume no liability for any trading losses resulting from use of this script.
Buy Sell SignalBuy Sell Signal - EMA Crossover with Dynamic Risk Management
OVERVIEW
This indicator combines a dual EMA crossover system with ATR-based dynamic stop loss and take profit levels to provide complete trade management signals. Unlike basic EMA crossover scripts, this tool automatically calculates and displays entry points, stop losses, and take profit targets based on market volatility, offering traders a complete trading framework in a single indicator.
HOW IT WORKS
The indicator uses three core components working together:
Trend Detection: A fast EMA (default 5) and slow EMA (default 13) identify trend direction. When the fast EMA crosses above the slow EMA, it signals bullish momentum; when it crosses below, it signals bearish momentum.
Entry Validation: Optional candle confirmation filter ensures the crossover is accompanied by a bullish/bearish candle close, reducing false signals in choppy markets.
Risk Management: Uses ATR (Average True Range, default 14 periods) to calculate:
Stop Loss: Positioned below/above recent swing low/high minus ATR multiplier (default 0.5x)
Take Profit: Calculated using customizable risk-reward ratio (default 3:1)
KEY FEATURES
โ
Automatic Position Tracking: Monitors active trades and displays current position status (LONG/SHORT/No position)
โ
Visual Trade Management: Shows entry price (white dashed line), stop loss (red line), and take profit (green line) in real-time
โ
Trade Outcome Signals: Displays clear markers when TP is hit (๐ฏ), SL is triggered (โ), or position is invalidated by opposite signal
โ
Information Dashboard: Live table showing entry price, SL, TP, and actual R:R ratio
โ
Smart Position Invalidation: Automatically closes and invalidates previous positions when opposite trend signal appears
โ
Customizable Alerts: Five alert conditions for BUY/SELL signals, TP hits, SL triggers, and invalidations
INPUTS
Fast EMA Length (default 5): Responsive to recent price action
Slow EMA Length (default 13): Defines broader trend direction
ATR Period (default 14): Volatility measurement period
SL Multiplier (default 0.5): Distance from swing point to stop loss
Risk:Reward Ratio (default 3.0): Target profit relative to risk
Candle Confirmation (default ON): Requires bullish/bearish candle on crossover
HOW TO USE
Apply the indicator to your chart (works on all timeframes)
Adjust EMA periods based on your trading style (shorter for scalping, longer for swing trading)
Set your preferred risk-reward ratio
Enable alerts for automated notifications
When a BUY/SELL signal appears, the indicator automatically calculates and displays your complete trade plan
Monitor the information table for live position updates
Exit when TP is reached or SL is triggered
TRADING METHODOLOGY
This script implements a momentum-following strategy based on exponential moving average crossovers, enhanced with volatility-adjusted risk parameters. The ATR-based stop loss adapts to market conditionsโwider stops in volatile markets, tighter stops in calm markets. The position invalidation feature prevents traders from holding outdated positions when market sentiment shifts.
BEST PRACTICES
Use on trending markets for best results
Higher timeframes (4H, Daily) produce fewer but more reliable signals.
For scalpe use 5 and 15 minutes(Risk).
Consider market context and fundamental factors alongside signals
Adjust ATR multiplier based on asset volatility
Test different EMA combinations for your preferred instruments
ORIGINALITY
While EMA crossover systems are common, this script's value lies in its complete integration of entry logic, dynamic risk management, position tracking, and automated invalidationโfeatures typically requiring multiple separate indicators. The ATR-based stop loss calculation and automatic R:R visualization provide practical trade execution guidance that basic crossover indicators lack.
Important Notes:
This indicator does not guarantee profitable trades
Always practice proper risk management
Backtest settings on historical data before live trading
Past performance does not indicate future results
STRATEGY 1 โ Red Dragon โ Model 1 โ Pro โ [Titans_Invest]The Red Dragon Model 1 is a fully automated trading strategy designed to operate BTC/USDT.P on the 4-hour chart with precision, stability, and consistency. It was built to deliver reliable behavior even during strong market movements, maintaining operational discipline and avoiding abrupt variations that could interfere with the traderโs decision-making.
Its core is based on a professionally engineered logical structure that combines trend filters, confirmation criteria, and balanced risk management. Every component was designed to work in an integrated way, eliminating noise, avoiding unnecessary trades, and protecting capital in critical moments. There are no secret mechanisms or hidden logic: everything is built to be objective, clean, and efficient.
Even though it is based on professional quantitative engineering, Red Dragon Model 1 remains extremely simple to operate. All logic is clearly displayed and fully accessible within TradingView itself, making it easy to understand for both beginners and experienced traders. The structure is organized so that any user can quickly view entry conditions, exit criteria, additional filters, adjustable parameters, and the full mechanics behind the strategyโs behavior.
In addition, the architecture was built to minimize unnecessary complexity. Parameters are straightforward, intuitive, and operate in a balanced way without requiring deep adjustments or advanced knowledge. Traders have full freedom to analyze the strategy, understand the logic, and make personal adaptations if desiredโalways with total transparency inside TradingView.
The strategy was also designed to deliver consistent operational behavior over the long term. Its confirmation criteria reduce impulsive trades; its filters isolate noise; and its overall logic prioritizes high-quality entries in structured market movements. The goal is to provide a stable, clear, and repeatable flowโessential characteristics for any medium-term quantitative approach.
Combining clarity, professional structure, and ease of use, Red Dragon Model 1 offers a solid foundation both for users who want a ready-to-use automated strategy and for those looking to study quantitative models in greater depth.
This entire project was built with extreme dedication, backed by more than 14,000 hours of hands-on experience in Pine Script, continuously refining patterns, techniques, and structures until reaching its current level of maturity. Every line of code reflects this long process of improvement, resulting in a strategy that unites professional engineering, transparency, accessibility, and reliable execution.
๐ถ MAIN FEATURES
โข Fully automated and robust: Operates without manual intervention, ideal for traders seeking consistency and stability. It delivers reliable performance even in volatile markets thanks to the solid quantitative engineering behind the system.
โข Multiple layers of confirmation: Combines 10 key technical indicators with 15 adaptive filters to avoid false signals. It only triggers entries when all trend, market strength, and contextual criteria align.
โข Configurable and adaptable filters: Each of the 15 filters can be enabled, disabled, or adjusted by the user, allowing the creation of personalized statistical models for different assets and timeframes. This flexibility gives full freedom to optimize the strategy according to individual preferences.
โข Clear and accessible logic: All entry and exit conditions are explicitly shown within the TradingView parameters. The strategy has no hidden componentsโany user can quickly analyze and understand each part of the system.
โข Integrated exclusive tools: Includes complete backtest tables (desktop and mobile versions) with annualized statistics, along with real-time entry conditions displayed directly on the chart. These tools help monitor the strategy across devices and track performance and risk metrics.
โข No repaint: All signals are static and do not change after being plotted. This ensures the trader can trust every entry shown without worrying about indicators rewriting past values.
๐ท ENTRY CONDITIONS & RISK MANAGEMENT
Red Dragon Model 1 triggers buy (long) or sell (short) signals only when all configured conditions are satisfied. For example:
โข Volume:
โข The system only trades when current volume exceeds the volume moving average multiplied by a user-defined factor, indicating meaningful market participation.
โข RSI:
โข Confirms bullish bias when RSI crosses above its moving average, and bearish bias when crossing below.
โข ADX:
โข Enters long when +DI is above โDI with ADX above a defined threshold, indicating directional strength to the upside (and the opposite conditions for shorts).
โข Other indicators (MACD, SAR, Ichimoku, Support/Resistance, etc.)
Each one must confirm the expected direction before a final signal is allowed.
When all bullish criteria are met simultaneously, the system enters Long; when all criteria indicate a bearish environment, the system enters Short.
In addition, the strategy uses fixed Take Profit and Stop Loss targets for risk control:
Currently: TP around 1.5% and SL around 2.0% per trade, ensuring consistent and transparent risk management on every position.
โ๏ธ INDICATORS
__________________________________________________________
ย ย 1) ๐ Volume: Avoids trading on flat charts.
ย ย 2) ๐ MACD: Tracks momentum through moving averages.
ย ย 3) ๐งฒ RSI: Indicates overbought or oversold conditions.
ย ย 4) ๐
ฐ๏ธ ADX: Measures trend strength and potential entry points.
ย ย 5) ๐ฅ SAR: Identifies changes in price direction.
ย ย 6) โ๏ธ Cloud: Accurately detects changes in market trends.
ย ย 7) ๐ก๏ธ R/F: Improves trend visualization and helps avoid pitfalls.
ย ย 8) ๐ S/R: Fixed support and resistance levels.
ย ย 9)โญโฏMA: Moving Averages.
10) ๐ฎ LR: Forecasting using Linear Regression.
__________________________________________________________
๐ข ENTRY CONDITIONS ๐ด
__________________________________________________________
IF all conditions are ๐ข = ๐ Long
IF all conditions are ๐ด = ๐ Short
__________________________________________________________
๐จ CURRENT TRIGGER SIGNAL ๐จ
__________________________________________________________
๐ Volume
๐ข LONG ย = (volume) > (MA_volume) * (Volume Mult)
๐ด SHORT = (volume) > (MA_volume) * (Volume Mult)
๐งฒ RSI
๐ข LONG ย = (RSI) > (RSI_MA)
๐ด SHORT = (RSI) < (RSI_MA)
๐ข ALL ENTRY CONDITIONS AVAILABLE ๐ด
__________________________________________________________
๐ Volume
๐ข LONGย ย = (volume) > (MA_volume) * (Volume Mult)
๐ด SHORT = (volume) > (MA_volume) * (Volume Mult)
๐ Volume
๐ข LONGย ย = (volume) > (MA_volume) * (Volume Mult) and (close) > (open)
๐ด SHORT = (volume) > (MA_volume) * (Volume Mult) and (close) < (open)
๐ MACD
๐ข LONGย ย = (MACD) > (Signal Smoothing)
๐ด SHORT = (MACD) < (Signal Smoothing)
๐งฒ RSI
๐ข LONGย ย = (RSI) < (Upper)
๐ด SHORT = (RSI) > (Lower)
๐งฒ RSI
๐ข LONGย ย = (RSI) > (RSI_MA)
๐ด SHORT = (RSI) < (RSI_MA)
๐
ฐ๏ธ ADX
๐ข LONGย ย = (+DI) > (-DI) and (ADX) > (Treshold)
๐ด SHORT = (+DI) < (-DI) and (ADX) > (Treshold)
๐ฅ SAR
๐ข LONGย ย = (close) > (SAR)
๐ด SHORT = (close) < (SAR)
โ๏ธ Cloud
๐ข LONGย ย = (Cloud A) > (Cloud B)
๐ด SHORT = (Cloud A) < (Cloud B)
โ๏ธ Cloud
๐ข LONGย ย = (Kama) > (Kama )
๐ด SHORT = (Kama) < (Kama )
๐ก๏ธ R/F
๐ข LONGย ย = (high) > (UP Range) ย ย ย ย ย and (upward) ย ย ย ย > (0)
๐ด SHORT = (low)ย < (DOWN Range) and (downward) > (0)
๐ก๏ธ R/F
๐ข LONGย ย = (high) > (UP Range)
๐ด SHORT = (low)ย < (DOWN Range)
๐ S/R
๐ข LONGย ย = (close) > (Resistance)
๐ด SHORT = (close) < (Support)
โญโฏMA2๏ธโฃ
๐ข LONGย ย = (Cyan Bar MA2๏ธโฃ)
๐ด SHORT = (Red Bar MA2๏ธโฃ)
โญโฏMA2๏ธโฃ
๐ข LONGย ย = (close) > (MA2๏ธโฃ)
๐ด SHORT = (close) < (MA2๏ธโฃ)
โญโฏMA2๏ธโฃ
๐ข LONGย ย = (Positive MA2๏ธโฃ)
๐ด SHORT = (Negative MA2๏ธโฃ)
__________________________________________________________
๐ฏ TP / SL ๐
__________________________________________________________
๐ฏ TP: 1.5 ๏ผ
๐ SL:ย 2.0 ๏ผ
__________________________________________________________
๐ช UNIQUE FEATURES OF THIS STRATEGY
____________________________________
1) ย ๐ ย Table Backtest for Mobile.
2) ย ๐ ย Table Backtest for Computer.
3) ย ๐ ย Table Backtest for Computer & Annual Performance.
4) ย ๐ ย Live Entry Conditions.
1) ย ๐ ย Table Backtest for Mobile.
2) ย ๐ ย Table Backtest for Computer.
3) ย ๐ ย Table Backtest for Computer & Annual Performance.
4) ย ๐ ย Live Entry Conditions.
_____________________________
๐ ย BACKTEST / PERFORMANCE ๐
_____________________________
โข Net Profit: +634.47%, Maximum Drawdown: -18.44%.
๐ช PAIR / TIMEFRAME โณ
๐ช PAIR: BINANCE:BTCUSDT.P
โณ TIME: 4 hours (240m)
โ
ON โ๏ธ OFF
โ
LONG
โ
SHORT
๐ฏ TP / SL ๐
๐ฏ TP:ย 1.5ย (๏ผ
)
๐ SL:ย ย 2.0ย (๏ผ
)
โ๏ธ CAPITAL MANAGEMENT
๐ธ Initial Capital: 10000 $ย (TradingView)
๐ฒ Order Size: ย ย ย ย ย 10 ๏ผ
ย ย ย ย ย (Of Equity)
๐ Leverage: ย ย ย ย ย ย ย 10 xย ย ย ย ย ย ย (Exchange)
๐ฉ Commission: ย ย ย 0.03 ๏ผ
ย ย (Exchange)
๐ BACKTEST
๐๏ธ Start: Setember 24, 2019
๐๏ธ End: ย ย November 21, 2025
๐๏ธ Days:ย ย 2250
๐๏ธ Yers:ย ย ย 6.17
๐๏ธ Bars:ย ย 13502
๐ PERFORMANCE
๐ฒ Net Profit:ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย + 63446.89 $
๐ข Net Profit:ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย + 634.47 ๏ผ
๐ฒ DrawDown Maximum: - 10727.48 $
๐ด DrawDown Maximum: - 18.44 ๏ผ
๐ข Total Closed Trades:ย ย ย ย ย 1042
๐ก Percent Profitable:ย ย ย ย ย ย ย 63.92 ๏ผ
๐ก Profit Factor:ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย 1.247
๐ฒ Avg Trade:ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย + 60.89 $
โฑ๏ธ Avg # Bars in Trades
๐ฏ๏ธ Avg # Bars: 4
โณ Avg # Hrs: ย 15
โ๏ธ Trades Winning: 666
โ Trades Losing: ย ย ย 376
โ๏ธ Maximum Consecutive Wins: ย ย 11
โ Maximum Consecutive Losses: 7
๐บ Live Performance : br.tradingview.com
โข Use this strategy on the recommended pair and timeframe above to replicate the tested results.
โข Feel free to experiment and explore other settings, assets, and timeframes.
(CRT) MTF Candle Range Theory Model# ๐ **CASH Pro MTF โ Candle Range Theory (CRT) Indicator**
**The Smart Money ICT Setup Detector** ๐ฅ
Hey Traders!
Here is the **ultimate Pine Script indicator** that automatically detects one of the most powerful Smart Money / ICT setups: **Candle Range Theory (CRT)**
---
### What is Candle Range Theory โ CRT?
**CRT** is a high-probability price action model based on **liquidity grabs** and **range expansion**.
Price loves to:
1๏ธโฃ Raid the low/high of the previous candle (take stop-losses)
2๏ธโฃ Then reverse and run to the opposite side of the range (or beyond)
When this happens near a **key higher-timeframe level**, magic happens!
### Bullish CRT Model
- Price touches a **strong HTF support**
- Previous candle closes near that support
- Next candle **sweeps the low** (grabs liquidity)
- Current candle **closes above the raided low AND breaks the high** of the sweep candle
**Result โ Aggressive bullish move expected!**
**Entry:** On close above the high (or on retest + MSS)
**Stop Loss:** Below the swept low
**Take Profit:** CRT High or next liquidity pool
### Bearish CRT Model
- Price touches a **strong HTF resistance**
- Previous candle closes near resistance
- Next candle **sweeps the high** (grabs buy stops)
- Current candle **closes below the raided high AND breaks the low** of the sweep candle
**Result โ Strong bearish expansion!**
**Entry:** On close below the low
**Stop Loss:** Above the swept high
**Take Profit:** CRT Low or next downside liquidity
This whole setup can form in **just 3 candles**โฆ or sometimes more if price consolidates after the sweep.
---
### Why This Indicator is Special
This is **NOT** a simple 3-candle pattern scanner!
This is a **true CRT + MTF confluence beast** with:
- **Multi-Timeframe Confirmation** (default 4H โ fully customizable)
- **Built-in RSI Filter** (avoid fake moves in overbought/oversold)
- **Day-2 High/Low Levels** automatically drawn (the exact CRT range!)
- **Clean โLONGโ / โSHORTโ labels** right on the candle (no ugly arrows or offset)
- **Background highlight** on signal
- **Fully grouped inputs** โ super clean settings panel
---
### Features at a Glance
| Feature | Included |
|--------------------------------|----------|
| Higher Timeframe Confirmation | Yes |
| RSI Overbought/Oversold Filter | Yes |
| Day-2 High/Low Lines + Labels | Yes |
| Clean Text Signals (no offset) | Yes |
| Background Highlight | Yes |
| Fully Customizable Colors & Text| Yes |
| Works on All Markets & TFs | Yes |
---
### How to Use
1. Add the indicator to your chart
2. Wait for a **LONG** or **SHORT** label to appear
3. Confirm price is near a **key HTF level** (order block, FVG, etc.)
4. Enter on close or retest (your choice)
5. Manage risk with the drawn Day-2 levels
**Pro Tip:** Combine with ICT Market Structure Shift (MSS) or Fair Value Gaps for even higher accuracy!
Luxy Super-Duper SuperTrend Predictor Engine and Buy/Sell signalA professional trend-following grading system that analyzes historical trend
patterns to provide statistical duration estimates using advanced similarity
matching and k-nearest neighbors analysis. Combines adaptive Supertrend with
intelligent duration statistics, multi-timeframe confluence, volume confirmation,
and quality scoring to identify high-probability setups with data-driven
target ranges across all timeframes.
Note: All duration estimates are statistical calculations based on historical data, not guarantees of future performance.
WHAT MAKES THIS DIFFERENT
Unlike traditional SuperTrend indicators that only tell you trend direction, this system answers the critical question: "What is the typical duration for trends like this?"
The Statistical Analysis Engine:
โข Analyzes your chart's last 15+ completed SuperTrend trends (bullish and bearish separately)
โข Uses k-nearest neighbors similarity matching to find historically similar setups
โข Calculates statistical duration estimates based on current market conditions
โข Learns from estimation errors and adapts over time (Advanced mode)
โข Displays visual duration analysis box showing median, average, and range estimates
โข Tracks Statistical accuracy with backtest statistics
Complete Trading System:
โข Statistical trend duration analysis with three intelligence levels
โข Adaptive Supertrend with dynamic ATR-based bands
โข Multi-timeframe confluence analysis (6 timeframes: 5M to 1W)
โข Volume confirmation with spike detection and momentum tracking
โข Quality scoring system (0-70 points) rating each setup
โข One-click preset optimization for all trading styles
โข Anti-repaint guarantee on all signals and duration estimates
METHODOLOGY CREDITS
This indicator's approach is inspired by proven trading methodologies from respected market educators:
โข Mark Minervini - Volatility Contraction Pattern (VCP) and pullback entry techniques
โข William O'Neil - Volume confirmation principles and institutional buying patterns (CANSLIM methodology)
โข Dan Zanger - Volatility expansion entries and momentum breakout strategies
Important: These are educational references only. This indicator does not guarantee any specific trading results. Always conduct your own analysis and risk management.
KEY FEATURES
1. TREND DURATION ANALYSIS SYSTEM - The Core Innovation
The statistical analysis engine is what sets this indicator apart from standard SuperTrend systems. It doesn't just identify trend changes - it provides statistical analysis of potential duration.
How It Works:
Step 1: Historical Tracking
โข Automatically records every completed SuperTrend trend (duration in bars)
โข Maintains separate databases for bullish trends and bearish trends
โข Stores up to 15 most recent trends of each type
โข Captures market conditions at each trend flip: volume ratio, ATR ratio, quality score, price distance from SuperTrend, proximity to support/resistance
Step 2: Similarity Matching (k-Nearest Neighbors)
โข When new trend begins, system compares current conditions to ALL historical flips
โข Calculates similarity score based on:
- Volume similarity (30% weight) - Is volume behaving similarly?
- Volatility similarity (30% weight) - Is ATR/volatility similar?
- Quality similarity (20% weight) - Is setup strength comparable?
- Distance similarity (10% weight) - Is price distance from ST similar?
- Support/Resistance proximity (10% weight) - Similar structural context?
โข Selects the 15 MOST SIMILAR historical trends (not just all trends)
โข This is like asking: "When conditions looked like this before, how long did trends last?"
Step 3: Statistical Analysis
โข Calculates median duration (most common outcome)
โข Calculates average duration (mean of similar trends)
โข Determines realistic range (min to max of similar trends)
โข Applies exponential weighting (recent trends weighted more heavily)
โข Outputs confidence-weighted statistical estimate
Step 4: Advanced Intelligence (Advanced Mode Only)
The Advanced mode applies five sophisticated multipliers to refine estimates:
A) Market Structure Multiplier (ยฑ30%):
โข Detects nearby support/resistance levels using pivot detection
โข If flip occurs NEAR a key level: Estimate adjusted -30% (expect bounce/rejection)
โข If flip occurs in open space: Estimate adjusted +30% (clear path for continuation)
โข Uses configurable lookback period and ATR-based proximity threshold
B) Asset Type Multiplier (ยฑ40%):
โข Adjusts duration estimates based on asset volatility characteristics
โข Small Cap / Biotech: +40% (explosive, extended moves)
โข Tech Growth: +20% (momentum-driven, longer trends)
โข Blue Chip / Large Cap: 0% (baseline, steady trends)
โข Dividend / Value: -20% (slower, grinding trends)
โข Cyclical: Variable based on macro regime
โข Crypto / High Volatility: +30% (parabolic potential)
C) Flip Strength Multiplier (ยฑ20%):
โข Analyzes the QUALITY of the trend flip itself
โข Strong flip (high volume + expanding ATR + quality score 60+): +20%
โข Weak flip (low volume + contracting ATR + quality score under 40): -20%
โข Logic: Historical data shows that powerful flips tend to be followed by longer trends
D) Error Learning Multiplier (ยฑ15%):
โข Tracks Statistical accuracy over last 10 completed trends
โข Calculates error ratio: (estimated duration / Actual Duration)
โข If system consistently over-estimates: Apply -15% correction
โข If system consistently under-estimates: Apply +15% correction
โข Learns and adapts to current market regime
E) Regime Detection Multiplier (ยฑ20%):
โข Analyzes last 3 trends of SAME TYPE (bull-to-bull or bear-to-bear)
โข Compares recent trend durations to historical average
โข If recent trends 20%+ longer than average: +20% adjustment (trending regime detected)
โข If recent trends 20%+ shorter than average: -20% adjustment (choppy regime detected)
โข Detects whether market is in trending or mean-reversion mode
Three analysis modes:
SIMPLE MODE - Basic Statistics
โข Uses raw median of similar trends only
โข No multipliers, no adjustments
โข Best for: Beginners, clean trending markets
โข Fastest calculations, minimal complexity
STANDARD MODE - Full Statistical Analysis
โข Similarity matching with k-nearest neighbors
โข Exponential weighting of recent trends
โข Median, average, and range calculations
โข Best for: Most traders, general market conditions
โข Balance of accuracy and simplicity
ADVANCED MODE - Statistics + Intelligence
โข Everything in Standard mode PLUS
โข All 5 advanced multipliers (structure, asset type, flip strength, learning, regime)
โข Highest Statistical accuracy in testing
โข Best for: Experienced traders, volatile/complex markets
โข Maximum intelligence, most adaptive
Visual Duration Analysis Box:
When a new trend begins (SuperTrend flip), a box appears on your chart showing:
โข Analysis Mode (Simple / Standard / Advanced)
โข Number of historical trends analyzed
โข Median expected duration (most likely outcome)
โข Average expected duration (mean of similar trends)
โข Range (minimum to maximum from similar trends)
โข Advanced multipliers breakdown (Advanced mode only)
โข Backtest accuracy statistics (if available)
The box extends from the flip bar to the estimated endpoint based on historical data, giving you a visual target for trend duration. Box updates in real-time as trend progresses.
Backtest & Accuracy Tracking:
โข System backtests its own duration estimates using historical data
โข Shows accuracy metrics: how well duration estimates matched actual durations
โข Tracks last 10 completed duration estimates separately
โข Displays statistics in dashboard and duration analysis boxes
โข Helps you understand statistical reliability on your specific symbol/timeframe
Anti-Repaint Guarantee:
โข duration analysis boxes only appear AFTER bar close (barstate.isconfirmed)
โข Historical duration estimates never disappear or change
โข What you see in history is exactly what you would have seen real-time
โข No future data leakage, no lookahead bias
2. INTELLIGENT PRESET CONFIGURATIONS - One-Click Optimization
Unlike indicators that require tedious parameter tweaking, this system includes professionally optimized presets for every trading style. Select your approach from the dropdown and ALL parameters auto-configure.
"AUTO (DETECT FROM TF)" - RECOMMENDED
The smartest option: automatically selects optimal settings based on your chart timeframe.
โข 1m-5m charts โ Scalping preset (ATR: 7, Mult: 2.0)
โข 15m-1h charts โ Day Trading preset (ATR: 10, Mult: 2.5)
โข 2h-4h-D charts โ Swing Trading preset (ATR: 14, Mult: 3.0)
โข W-M charts โ Position Trading preset (ATR: 21, Mult: 4.0)
Benefits:
โข Zero configuration - works immediately
โข Always matched to your timeframe
โข Switch timeframe = automatic adjustment
โข Perfect for traders who use multiple timeframes
"SCALPING (1-5M)" - Ultra-Fast Signals
Optimized for: 1-5 minute charts, high-frequency trading, quick profits
Target holding period: Minutes to 1-2 hours maximum
Best markets: High-volume stocks, major crypto pairs, active futures
Parameter Configuration:
โข Supertrend: ATR 7, Multiplier 2.0 (very sensitive)
โข Volume: MA 10, High 1.8x, Spike 3.0x (catches quick surges)
โข Volume Momentum: AUTO-DISABLED (too restrictive for fast scalping)
โข Quality minimum: 40 points (accepts more setups)
โข Duration Analysis: Uses last 15 trends with heavy recent weighting
Trading Logic:
Speed over precision. Short ATR period and low multiplier create highly responsive SuperTrend. Volume momentum filter disabled to avoid missing fast moves. Quality threshold relaxed to catch more opportunities in rapid market conditions.
Signals per session: 5-15 typically
Hold time: Minutes to couple hours
Best for: Active traders with fast execution
"DAY TRADING (15M-1H)" - Balanced Approach
Optimized for: 15-minute to 1-hour charts, intraday moves, session-based trading
Target holding period: 30 minutes to 8 hours (within trading day)
Best markets: Large-cap stocks, major indices, established crypto
Parameter Configuration:
โข Supertrend: ATR 10, Multiplier 2.5 (balanced)
โข Volume: MA 20, High 1.5x, Spike 2.5x (standard detection)
โข Volume Momentum: 5/20 periods (confirms intraday strength)
โข Quality minimum: 50 points (good setups preferred)
โข Duration Analysis: Balanced weighting of recent vs historical
Trading Logic:
The most balanced configuration. ATR 10 with multiplier 2.5 provides steady trend following that avoids noise while catching meaningful moves. Volume momentum confirms institutional participation without being overly restrictive.
Signals per session: 2-5 typically
Hold time: 30 minutes to full day
Best for: Part-time and full-time active traders
"SWING TRADING (4H-D)" - Trend Stability
Optimized for: 4-hour to Daily charts, multi-day holds, trend continuation
Target holding period: 2-15 days typically
Best markets: Growth stocks, sector ETFs, trending crypto, commodity futures
Parameter Configuration:
โข Supertrend: ATR 14, Multiplier 3.0 (stable)
โข Volume: MA 30, High 1.3x, Spike 2.2x (accumulation focus)
โข Volume Momentum: 10/30 periods (trend stability)
โข Quality minimum: 60 points (high-quality setups only)
โข Duration Analysis: Favors consistent historical patterns
Trading Logic:
Designed for substantial trend moves while filtering short-term noise. Higher ATR period and multiplier create stable SuperTrend that won't flip on minor corrections. Stricter quality requirements ensure only strongest setups generate signals.
Signals per week: 2-5 typically
Hold time: Days to couple weeks
Best for: Part-time traders, swing style
"POSITION TRADING (D-W)" - Long-Term Trends
Optimized for: Daily to Weekly charts, major trend changes, portfolio allocation
Target holding period: Weeks to months
Best markets: Blue-chip stocks, major indices, established cryptocurrencies
Parameter Configuration:
โข Supertrend: ATR 21, Multiplier 4.0 (very stable)
โข Volume: MA 50, High 1.2x, Spike 2.0x (long-term accumulation)
โข Volume Momentum: 20/50 periods (major trend confirmation)
โข Quality minimum: 70 points (excellent setups only)
โข Duration Analysis: Heavy emphasis on multi-year historical data
Trading Logic:
Conservative approach focusing on major trend changes. Extended ATR period and high multiplier create SuperTrend that only flips on significant reversals. Very strict quality filters ensure signals represent genuine long-term opportunities.
Signals per month: 1-2 typically
Hold time: Weeks to months
Best for: Long-term investors, set-and-forget approach
"CUSTOM" - Advanced Configuration
Purpose: Complete manual control for experienced traders
Use when: You understand the parameters and want specific optimization
Best for: Testing new approaches, unusual market conditions, specific instruments
Full control over:
โข All SuperTrend parameters
โข Volume thresholds and momentum periods
โข Quality scoring weights
โข analysis mode and multipliers
โข Advanced features tuning
Preset Comparison Quick Reference:
Chart Timeframe: Scalping (1M-5M) | Day Trading (15M-1H) | Swing (4H-D) | Position (D-W)
Signals Frequency: Very High | High | Medium | Low
Hold Duration: Minutes | Hours | Days | Weeks-Months
Quality Threshold: 40 pts | 50 pts | 60 pts | 70 pts
ATR Sensitivity: Highest | Medium | Lower | Lowest
Time Investment: Highest | High | Medium | Lowest
Experience Level: Expert | Advanced | Intermediate | Beginner+
3. QUALITY SCORING SYSTEM (0-70 Points)
Every signal is rated in real-time across three dimensions:
Volume Confirmation (0-30 points):
โข Volume Spike (2.5x+ average): 30 points
โข High Volume (1.5x+ average): 20 points
โข Above Average (1.0x+ average): 10 points
โข Below Average: 0 points
Volatility Assessment (0-30 points):
โข Expanding ATR (1.2x+ average): 30 points
โข Rising ATR (1.0-1.2x average): 15 points
โข Contracting/Stable ATR: 0 points
Volume Momentum (0-10 points):
โข Strong Momentum (1.2x+ ratio): 10 points
โข Rising Momentum (1.0-1.2x ratio): 5 points
โข Weak/Neutral Momentum: 0 points
Score Interpretation:
60-70 points - EXCELLENT:
โข All factors aligned
โข High conviction setup
โข Maximum position size (within risk limits)
โข Primary trading opportunities
45-59 points - STRONG:
โข Multiple confirmations present
โข Above-average setup quality
โข Standard position size
โข Good trading opportunities
30-44 points - GOOD:
โข Basic confirmations met
โข Acceptable setup quality
โข Reduced position size
โข Wait for additional confirmation or trade smaller
Below 30 points - WEAK:
โข Minimal confirmations
โข Low probability setup
โข Consider passing
โข Only for aggressive traders in strong trends
Only signals meeting your minimum quality threshold (configurable per preset) generate alerts and labels.
4. MULTI-TIMEFRAME CONFLUENCE ANALYSIS
The system can simultaneously analyze trend alignment across 6 timeframes (optional feature):
Timeframes analyzed:
โข 5-minute (scalping context)
โข 15-minute (intraday momentum)
โข 1-hour (day trading bias)
โข 4-hour (swing context)
โข Daily (primary trend)
โข Weekly (macro trend)
Confluence Interpretation:
โข 5-6/6 aligned - Very strong multi-timeframe agreement (highest confidence)
โข 3-4/6 aligned - Moderate agreement (standard setup)
โข 1-2/6 aligned - Weak agreement (caution advised)
Dashboard shows real-time alignment count with color-coding. Higher confluence typically correlates with longer, stronger trends.
5. VOLUME MOMENTUM FILTER - Institutional Money Flow
Unlike traditional volume indicators that just measure size, Volume Momentum tracks the RATE OF CHANGE in volume:
How it works:
โข Compares short-term volume average (fast period) to long-term average (slow period)
โข Ratio above 1.0 = Volume accelerating (money flowing IN)
โข Ratio above 1.2 = Strong acceleration (institutional participation likely)
โข Ratio below 0.8 = Volume decelerating (money flowing OUT)
Why it matters:
โข Confirms trend with actual money flow, not just price
โข Leading indicator (volume often leads price)
โข Catches accumulation/distribution before breakouts
โข More intuitive than complex mathematical filters
Integration with signals:
โข Optional filter - can be enabled/disabled per preset
โข When enabled: Only signals with rising volume momentum fire
โข AUTO-DISABLED in Scalping mode (too restrictive for fast trading)
โข Configurable fast/slow periods per trading style
6. ADAPTIVE SUPERTREND MULTIPLIER
Traditional SuperTrend uses fixed ATR multiplier. This system dynamically adjusts the multiplier (0.8x to 1.2x base) based on:
โข Trend Strength: Price correlation over lookback period
โข Volume Weight: Current volume relative to average
Benefits:
โข Tighter bands in calm markets (less premature exits)
โข Wider bands in volatile conditions (avoids whipsaws)
โข Better adaptation to biotech, small-cap, and crypto volatility
โข Optional - can be disabled for classic constant multiplier
7. VISUAL GRADIENT RIBBON
26-layer exponential gradient fill between price and SuperTrend line provides instant visual trend strength assessment:
Color System:
โข Green shades - Bullish trend + volume confirmation (strongest)
โข Blue shades - Bullish trend, normal volume
โข Orange shades - Bearish trend + volume confirmation
โข Red shades - Bearish trend (weakest)
Opacity varies based on:
โข Distance from SuperTrend (farther = more opaque)
โข Volume intensity (higher volume = stronger color)
The ribbon provides at-a-glance trend strength without cluttering your chart. Can be toggled on/off.
8. INTELLIGENT ALERT SYSTEM
Two-tier alert architecture for flexibility:
Automatic Alerts:
โข Fire automatically on BUY and SELL signals
โข Include full context: quality score, volume state, volume momentum
โข One alert per bar close (alert.freq_once_per_bar_close)
โข Message format: "BUY: Supertrend bullish + Quality: 65/70 | Volume: HIGH | Vol Momentum: STRONG (1.35x)"
Customizable Alert Conditions:
โข Appear in TradingView's "Create Alert" dialog
โข Three options: BUY Signal Only, SELL Signal Only, ANY Signal (BUY or SELL)
โข Use TradingView placeholders: {{ticker}}, {{interval}}, {{close}}, {{time}}
โข Fully customizable message templates
All alerts use barstate.isconfirmed - Zero repaint guarantee.
9. ANTI-REPAINT ARCHITECTURE
Every component guaranteed non-repainting:
โข Entry signals: Only appear after bar close
โข duration analysis boxes: Created only on confirmed SuperTrend flips
โข Informative labels: Wait for bar confirmation
โข Alerts: Fire once per closed bar
โข Multi-timeframe data: Uses lookahead=barmerge.lookahead_off
What you see in history is exactly what you would have seen in real-time. No disappearing signals, no changed duration estimates.
HOW TO USE THE INDICATOR
QUICK START - 3 Steps to Trading:
Step 1: Select Your Trading Style
Open indicator settings โ "Quick Setup" section โ Trading Style Preset dropdown
Options:
โข Auto (Detect from TF) - RECOMMENDED: Automatically configures based on your chart timeframe
โข Scalping (1-5m) - For 1-5 minute charts, ultra-fast signals
โข Day Trading (15m-1h) - For 15m-1h charts, balanced approach
โข Swing Trading (4h-D) - For 4h-Daily charts, trend stability
โข Position Trading (D-W) - For Daily-Weekly charts, long-term trends
โข Custom - Manual configuration (advanced users only)
Choose "Auto" and you're done - all parameters optimize automatically.
Step 2: Understand the Signals
BUY Signal (Green Triangle Below Price):
โข SuperTrend flipped bullish
โข Quality score meets minimum threshold (varies by preset)
โข Volume confirmation present (if filter enabled)
โข Volume momentum rising (if filter enabled)
โข duration analysis box shows expected trend duration
SELL Signal (Red Triangle Above Price):
โข SuperTrend flipped bearish
โข Quality score meets minimum threshold
โข Volume confirmation present (if filter enabled)
โข Volume momentum rising (if filter enabled)
โข duration analysis box shows expected trend duration
Duration Analysis Box:
โข Appears at SuperTrend flip (start of new trend)
โข Shows median, average, and range duration estimates
โข Extends to estimated endpoint based on historical data visually
โข Updates mode-specific intelligence (Simple/Standard/Advanced)
Step 3: Use the Dashboard for Context
Dashboard (top-right corner) shows real-time metrics:
โข Row 1 - Quality Score: Current setup rating (0-70)
โข Row 2 - SuperTrend: Direction and current level
โข Row 3 - Volume: Status (Spike/High/Normal/Low) with color
โข Row 4 - Volatility: State (Expanding/Rising/Stable/Contracting)
โข Row 5 - Volume Momentum: Ratio and trend
โข Row 6 - Duration Statistics: Accuracy metrics and track record
Every cell has detailed tooltip - hover for full explanations.
SIGNAL INTERPRETATION BY QUALITY SCORE:
Excellent Setup (60-70 points):
โข Quality Score: 60-70
โข Volume: Spike or High
โข Volatility: Expanding
โข Volume Momentum: Strong (1.2x+)
โข MTF Confluence (if enabled): 5-6/6
โข Action: Primary trade - maximum position size (within risk limits)
โข Statistical reliability: Highest - duration estimates most accurate
Strong Setup (45-59 points):
โข Quality Score: 45-59
โข Volume: High or Above Average
โข Volatility: Rising
โข Volume Momentum: Rising (1.0-1.2x)
โข MTF Confluence (if enabled): 3-4/6
โข Action: Standard trade - normal position size
โข Statistical reliability: Good - duration estimates reliable
Good Setup (30-44 points):
โข Quality Score: 30-44
โข Volume: Above Average
โข Volatility: Stable or Rising
โข Volume Momentum: Neutral to Rising
โข MTF Confluence (if enabled): 3-4/6
โข Action: Cautious trade - reduced position size, wait for additional confirmation
โข Statistical reliability: Moderate - duration estimates less certain
Weak Setup (Below 30 points):
โข Quality Score: Below 30
โข Volume: Low or Normal
โข Volatility: Contracting or Stable
โข Volume Momentum: Weak
โข MTF Confluence (if enabled): 1-2/6
โข Action: Pass or wait for improvement
โข Statistical reliability: Low - duration estimates unreliable
USING duration analysis boxES FOR TRADE MANAGEMENT:
Entry Timing:
โข Enter on SuperTrend flip (signal bar close)
โข duration analysis box appears simultaneously
โข Note the median duration - this is your expected hold time
Profit Targets:
โข Conservative: Use MEDIAN duration as profit target (50% probability)
โข Moderate: Use AVERAGE duration (mean of similar trends)
โข Aggressive: Aim for MAX duration from range (best historical outcome)
Position Management:
โข Scale out at median duration (take partial profits)
โข Trail stop as trend extends beyond median
โข Full exit at average duration or SuperTrend flip (whichever comes first)
โข Re-evaluate if trend exceeds estimated range
analysis mode Selection:
โข Simple: Clean trending markets, beginners, minimal complexity
โข Standard: Most markets, most traders (recommended default)
โข Advanced: Volatile markets, complex instruments, experienced traders seeking highest accuracy
Asset Type Configuration (Advanced Mode):
If using Advanced analysis mode, configure Asset Type for optimal accuracy:
โข Small Cap: Stocks under $2B market cap, low liquidity
โข Biotech / Speculative: Clinical-stage pharma, penny stocks, high-risk
โข Blue Chip / Large Cap: S&P 500, mega-cap tech, stable large companies
โข Tech Growth: High-growth tech (TSLA, NVDA, growth SaaS)
โข Dividend / Value: Dividend aristocrats, value stocks, utilities
โข Cyclical: Energy, materials, industrials (macro-driven)
โข Crypto / High Volatility: Bitcoin, altcoins, highly volatile assets
Correct asset type selection improves Statistical accuracy by 15-20%.
RISK MANAGEMENT GUIDELINES:
1. Stop Loss Placement:
Long positions:
โข Place stop below recent swing low OR
โข Place stop below SuperTrend level (whichever is tighter)
โข Use 1-2 ATR distance as guideline
โข Recommended: SuperTrend level (built-in volatility adjustment)
Short positions:
โข Place stop above recent swing high OR
โข Place stop above SuperTrend level (whichever is tighter)
โข Use 1-2 ATR distance as guideline
โข Recommended: SuperTrend level
2. Position Sizing by Quality Score:
โข Excellent (60-70): Maximum position size (2% risk per trade)
โข Strong (45-59): Standard position size (1.5% risk per trade)
โข Good (30-44): Reduced position size (1% risk per trade)
โข Weak (Below 30): Pass or micro position (0.5% risk - learning trades only)
3. Exit Strategy Options:
Option A - Statistical Duration-Based Exit:
โข Exit at median estimated duration (conservative)
โข Exit at average estimated duration (moderate)
โข Trail stop beyond average duration (aggressive)
Option B - Signal-Based Exit:
โข Exit on opposite signal (SELL after BUY, or vice versa)
โข Exit on SuperTrend flip (trend reversal)
โข Exit if quality score drops below 30 mid-trend
Option C - Hybrid (Recommended):
โข Take 50% profit at median estimated duration
โข Trail stop on remaining 50% using SuperTrend as trailing level
โข Full exit on SuperTrend flip or quality collapse
4. Trade Filtering:
For higher win-rate (fewer trades, better quality):
โข Increase minimum quality score (try 60 for swing, 50 for day trading)
โข Enable volume momentum filter (ensure institutional participation)
โข Require higher MTF confluence (5-6/6 alignment)
โข Use Advanced analysis mode with appropriate asset type
For more opportunities (more trades, lower quality threshold):
โข Decrease minimum quality score (40 for day trading, 35 for scalping)
โข Disable volume momentum filter
โข Lower MTF confluence requirement
โข Use Simple or Standard analysis mode
SETTINGS OVERVIEW
Quick Setup Section:
โข Trading Style Preset: Auto / Scalping / Day Trading / Swing / Position / Custom
Dashboard & Display:
โข Show Dashboard (ON/OFF)
โข Dashboard Position (9 options: Top/Middle/Bottom + Left/Center/Right)
โข Text Size (Auto/Tiny/Small/Normal/Large/Huge)
โข Show Ribbon Fill (ON/OFF)
โข Show SuperTrend Line (ON/OFF)
โข Bullish Color (default: Green)
โข Bearish Color (default: Red)
โข Show Entry Labels - BUY/SELL signals (ON/OFF)
โข Show Info Labels - Volume events (ON/OFF)
โข Label Size (Auto/Tiny/Small/Normal/Large/Huge)
Supertrend Configuration:
โข ATR Length (default varies by preset: 7-21)
โข ATR Multiplier Base (default varies by preset: 2.0-4.0)
โข Use Adaptive Multiplier (ON/OFF) - Dynamic 0.8x-1.2x adjustment
โข Smoothing Factor (0.0-0.5) - EMA smoothing applied to bands
โข Neutral Bars After Flip (0-10) - Hide ST immediately after flip
Volume Momentum:
โข Enable Volume Momentum Filter (ON/OFF)
โข Fast Period (default varies by preset: 3-20)
โข Slow Period (default varies by preset: 10-50)
Volume Analysis:
โข Volume MA Length (default varies by preset: 10-50)
โข High Volume Threshold (default: 1.5x)
โข Spike Threshold (default: 2.5x)
โข Low Volume Threshold (default: 0.7x)
Quality Filters:
โข Minimum Quality Score (0-70, varies by preset)
โข Require Volume Confirmation (ON/OFF)
Trend Duration Analysis:
โข Show Duration Analysis (ON/OFF) - Display duration analysis boxes
โข analysis mode - Simple / Standard / Advanced
โข Asset Type - 7 options (Small Cap, Biotech, Blue Chip, Tech Growth, Dividend, Cyclical, Crypto)
โข Use Exponential Weighting (ON/OFF) - Recent trends weighted more
โข Decay Factor (0.5-0.99) - How much more recent trends matter
โข Structure Lookback (3-30) - Pivot detection period for support/resistance
โข Proximity Threshold (xATR) - How close to level qualifies as "near"
โข Enable Error Learning (ON/OFF) - System learns from estimation errors
โข Memory Depth (3-20) - How many past errors to remember
Box Visual Settings:
โข duration analysis box Border Color
โข duration analysis box Background Color
โข duration analysis box Text Color
โข duration analysis box Border Width
โข duration analysis box Transparency
Multi-Timeframe (Optional Feature):
โข Enable MTF Confluence (ON/OFF)
โข Minimum Alignment Required (0-6)
โข Individual timeframe enable/disable toggles
โข Custom timeframe selection options
All preset configurations override manual inputs except when "Custom" is selected.
ADVANCED FEATURES
1. Scalpel Mode (Optional)
Advanced pullback entry system that waits for healthy retracements within established trends before signaling entry:
โข Monitors price distance from SuperTrend levels
โข Requires pullback to configurable range (default: 30-50%)
โข Ensures trend remains intact before entry signal
โข Reduces whipsaw and false breakouts
โข Inspired by Mark Minervini's VCP pullback entries
Best for: Swing traders and day traders seeking precision entries
Scalpers: Consider disabling for faster entries
2. Error Learning System (Advanced analysis mode Only)
The system learns from its own estimation errors:
โข Tracks last 10-20 completed duration estimates (configurable memory depth)
โข Calculates error ratio for each: estimated duration / Actual Duration
โข If system consistently over-estimates: Applies negative correction (-15%)
โข If system consistently under-estimates: Applies positive correction (+15%)
โข Adapts to current market regime automatically
This self-correction mechanism improves accuracy over time as the system gathers more data on your specific symbol and timeframe.
3. Regime Detection (Advanced analysis mode Only)
Automatically detects whether market is in trending or choppy regime:
โข Compares last 3 trends to historical average
โข Recent trends 20%+ longer โ Trending regime (+20% to estimates)
โข Recent trends 20%+ shorter โ Choppy regime (-20% to estimates)
โข Applied separately to bullish and bearish trends
Helps duration estimates adapt to changing market conditions without manual intervention.
4. Exponential Weighting
Option to weight recent trends more heavily than distant history:
โข Default decay factor: 0.9
โข Recent trends get higher weight in statistical calculations
โข Older trends gradually decay in importance
โข Rationale: Recent market behavior more relevant than old data
โข Can be disabled for equal weighting
5. Backtest Statistics
System backtests its own duration estimates using historical data:
โข Walks through past trends chronologically
โข Calculates what duration estimate WOULD have been at each flip
โข Compares to actual duration that occurred
โข Displays accuracy metrics in duration analysis boxes and dashboard
โข Helps assess statistical reliability on your specific chart
Note: Backtest uses only data available AT THE TIME of each historical flip (no lookahead bias).
TECHNICAL SPECIFICATIONS
โข Pine Script Version: v6
โข Indicator Type: Overlay (draws on price chart)
โข Max Boxes: 500 (for duration analysis box storage)
โข Max Bars Back: 5000 (for comprehensive historical analysis)
โข Security Calls: 1 (for MTF if enabled - optimized)
โข Repainting: NO - All signals and duration estimates confirmed on bar close
โข Lookahead Bias: NO - All HTF data properly offset, all duration estimates use only historical data
โข Real-time Updates: YES - Dashboard and quality scores update live
โข Alert Capable: YES - Both automatic alerts and customizable alert conditions
โข Multi-Symbol: Works on stocks, crypto, forex, futures, indices
Performance Optimization:
โข Conditional calculations (duration analysis can be disabled to reduce load)
โข Efficient array management (circular buffers for trend storage)
โข Streamlined gradient rendering (26 layers, can be toggled off)
โข Smart label cooldown system (prevents label spam)
โข Optimized similarity matching (analyzes only relevant trends)
Data Requirements:
โข Minimum 50-100 bars for initial duration analysis (builds historical database)
โข Optimal: 500+ bars for robust statistical analysis
โข Longer history = more accurate duration estimates
โข Works on any timeframe from 1 minute to monthly
KNOWN LIMITATIONS
โข Trending Markets Only: Performs best in clear trends. May generate false signals in choppy/sideways markets (use quality score filtering and regime detection to mitigate)
โข Lagging Nature: Like all trend-following systems, signals occur AFTER trend establishment, not at exact tops/bottoms. Use duration analysis boxes to set realistic profit targets.
โข Initial Learning Period: Duration analysis system requires 10-15 completed trends to build reliable historical database. Early duration estimates less accurate (first few weeks on new symbol/timeframe).
โข Visual Load: 26-layer gradient ribbon may slow performance on older devices. Disable ribbon if experiencing lag.
โข Statistical accuracy Variables: Duration estimates are statistical estimates, not guarantees. Accuracy varies by:
- Market regime (trending vs choppy)
- Asset volatility characteristics
- Quality of historical pattern matches
- Timeframe traded (higher TF = more reliable)
โข Not Best Suitable For:
- Ultra-short-term scalping (sub-1-minute charts)
- Mean-reversion strategies (designed for trend-following)
- Range-bound trading (requires trending conditions)
- News-driven spikes (estimates based on technical patterns, not fundamentals)
FREQUENTLY ASKED QUESTIONS
Q: Does this indicator repaint?
A: Absolutely not. All signals, duration analysis boxes, labels, and alerts use barstate.isconfirmed checks. They only appear after the bar closes. What you see in history is exactly what you would have seen in real-time. Zero repaint guarantee.
Q: How accurate are the trend duration estimates?
A: Accuracy varies by mode, market conditions, and historical data quality:
โข Simple mode: 60-70% accuracy (within ยฑ20% of actual duration)
โข Standard mode: 70-80% accuracy (within ยฑ20% of actual duration)
โข Advanced mode: 75-85% accuracy (within ยฑ20% of actual duration)
Best accuracy achieved on:
โข Higher timeframes (4H, Daily, Weekly)
โข Trending markets (not choppy/sideways)
โข Assets with consistent behavior (Blue Chip, Large Cap)
โข After 20+ historical trends analyzed (builds robust database)
Remember: All duration estimates are statistical calculations based on historical patterns, not guarantees.
Q: Which analysis mode should I use?
A:
โข Simple: Beginners, clean trending markets, want minimal complexity
โข Standard: Most traders, general market conditions (RECOMMENDED DEFAULT)
โข Advanced: Experienced traders, volatile/complex markets (biotech, small-cap, crypto), seeking maximum accuracy
Advanced mode requires correct Asset Type configuration for optimal results.
Q: What's the difference between the trading style presets?
A: Each preset optimizes ALL parameters for a specific trading approach:
โข Scalping: Ultra-sensitive (ATR 7, Mult 2.0), more signals, shorter holds
โข Day Trading: Balanced (ATR 10, Mult 2.5), moderate signals, intraday holds
โข Swing Trading: Stable (ATR 14, Mult 3.0), fewer signals, multi-day holds
โข Position Trading: Very stable (ATR 21, Mult 4.0), rare signals, week/month holds
Auto mode automatically selects based on your chart timeframe.
Q: Should I use Auto mode or manually select a preset?
A: Auto mode is recommended for most traders. It automatically matches settings to your timeframe and re-optimizes if you switch charts. Only use manual preset selection if:
โข You want scalping settings on a 15m chart (overriding auto-detection)
โข You want swing settings on a 1h chart (more conservative than auto would give)
โข You're testing different approaches on same timeframe
Q: Can I use this for scalping and day trading?
A: Absolutely! The preset system is specifically designed for all trading styles:
โข Select "Scalping (1-5m)" for 1-5 minute charts
โข Select "Day Trading (15m-1h)" for 15m-1h charts
โข Or use "Auto" mode and it configures automatically
Volume momentum filter is auto-disabled in Scalping mode for faster signals.
Q: What is Volume Momentum and why does it matter?
A: Volume Momentum compares short-term volume (fast MA) to long-term volume (slow MA). It answers: "Is money flowing into this asset faster now than historically?"
Why it matters:
โข Volume often leads price (early warning system)
โข Confirms institutional participation (smart money)
โข No lag like price-based indicators
โข More intuitive than complex mathematical filters
When the ratio is above 1.2, you have strong evidence that institutions are accumulating (bullish) or distributing (bearish).
Q: How do I set up alerts?
A: Two options:
Option 1 - Automatic Alerts:
1. Right-click on chart โ Add Alert
2. Condition: Select this indicator
3. Choose "Any alert() function call"
4. Configure notification method (app, email, webhook)
5. You'll receive detailed alerts on every BUY and SELL signal
Option 2 - Customizable Alert Conditions:
1. Right-click on chart โ Add Alert
2. Condition: Select this indicator
3. You'll see three options in dropdown:
- "BUY Signal" (long signals only)
- "SELL Signal" (short signals only)
- "ANY Signal" (both BUY and SELL)
4. Choose desired option and customize message template
5. Uses TradingView placeholders: {{ticker}}, {{close}}, {{time}}, etc.
All alerts fire only on confirmed bar close (no repaint).
Q: What is Scalpel Mode and should I use it?
A: Scalpel Mode waits for healthy pullbacks within established trends before signaling entry. It reduces whipsaws and improves entry timing.
Recommended ON for:
โข Swing traders (want precision entries on pullbacks)
โข Day traders (willing to wait for better prices)
โข Risk-averse traders (prefer fewer but higher-quality entries)
Recommended OFF for:
โข Scalpers (need immediate entries, can't wait for pullbacks)
โข Momentum traders (want to enter on breakout, not pullback)
โข Aggressive traders (prefer more opportunities over precision)
Q: Why do some duration estimates show wider ranges than others?
A: Range width reflects historical trend variability:
โข Narrow range: Similar historical trends had consistent durations (high confidence)
โข Wide range: Similar historical trends had varying durations (lower confidence)
Wide ranges often occur:
โข Early in analysis (fewer historical trends to learn from)
โข In volatile/choppy markets (inconsistent trend behavior)
โข On lower timeframes (more noise, less consistency)
The median and average still provide useful targets even when range is wide.
Q: Can I customize the dashboard position and appearance?
A: Yes! Dashboard settings include:
โข Position: 9 options (Top/Middle/Bottom + Left/Center/Right)
โข Text Size: Auto, Tiny, Small, Normal, Large, Huge
โข Show/Hide: Toggle entire dashboard on/off
Choose position that doesn't overlap important price action on your specific chart.
Q: Which timeframe should I trade on?
A: Depends on your trading style and time availability:
โข 1-5 minute: Active scalping, requires constant monitoring
โข 15m-1h: Day trading, check few times per session
โข 4h-Daily: Swing trading, check once or twice daily
โข Daily-Weekly: Position trading, check weekly
General principle: Higher timeframes produce:
โข Fewer signals (less frequent)
โข Higher quality setups (stronger confirmations)
โข More reliable duration estimates (better statistical data)
โข Less noise (clearer trends)
Start with Daily chart if new to trading. Move to lower timeframes as you gain experience.
Q: Does this work on all markets (stocks, crypto, forex)?
A: Yes, it works on all markets with trending characteristics:
Excellent for:
โข Stocks (especially growth and momentum names)
โข Crypto (BTC, ETH, major altcoins)
โข Futures (indices, commodities)
โข Forex majors (EUR/USD, GBP/USD, etc.)
Best results on:
โข Trending markets (not range-bound)
โข Liquid instruments (tight spreads, good fills)
โข Volatile assets (clear trend development)
Less effective on:
โข Range-bound/sideways markets
โข Ultra-low volatility instruments
โข Illiquid small-caps (use caution)
Configure Asset Type (in Advanced analysis mode) to match your instrument for best accuracy.
Q: How many signals should I expect per day/week?
A: Highly variable based on:
By Timeframe:
โข 1-5 minute: 5-15 signals per session
โข 15m-1h: 2-5 signals per day
โข 4h-Daily: 2-5 signals per week
โข Daily-Weekly: 1-2 signals per month
By Market Volatility:
โข High volatility = more SuperTrend flips = more signals
โข Low volatility = fewer flips = fewer signals
By Quality Filter:
โข Higher threshold (60-70) = fewer but better signals
โข Lower threshold (30-40) = more signals, lower quality
By Volume Momentum Filter:
โข Enabled = Fewer signals (only volume-confirmed)
โข Disabled = More signals (all SuperTrend flips)
Adjust quality threshold and filters to match your desired signal frequency.
Q: What's the difference between entry labels and info labels?
A:
Entry Labels (BUY/SELL):
โข Your primary trading signals
โข Based on SuperTrend flip + all confirmations (quality, volume, momentum)
โข Include quality score and confirmation icons
โข These are actionable entry points
Info Labels (Volume Spike):
โข Additional market context
โข Show volume events that may support or contradict trend
โข 8-bar cooldown to prevent spam
โข NOT necessarily entry points - contextual information only
Control separately: Can show entry labels without info labels (recommended for clean charts).
Q: Can I combine this with other indicators?
A: Absolutely! This works well with:
โข RSI: For divergences and overbought/oversold conditions
โข Support/Resistance: Confluence with key levels
โข Fibonacci Retracements: Pullback targets in Scalpel Mode
โข Price Action Patterns: Flags, pennants, cup-and-handle
โข MACD: Additional momentum confirmation
โข Bollinger Bands: Volatility context
This indicator provides trend direction and duration estimates - complement with other tools for entry refinement and additional confluence.
Q: Why did I get a low-quality signal? Can I filter them out?
A: Yes! Increase the Minimum Quality Score in settings.
If you're seeing signals with quality below your preference:
โข Day Trading: Set minimum to 50
โข Swing Trading: Set minimum to 60
โข Position Trading: Set minimum to 70
Only signals meeting the threshold will appear. This reduces frequency but improves win-rate.
Q: How do I interpret the MTF Confluence count?
A: Shows how many of 6 timeframes agree with current trend:
โข 6/6 aligned: Perfect agreement (extremely rare, highest confidence)
โข 5/6 aligned: Very strong alignment (high confidence)
โข 4/6 aligned: Good alignment (standard quality setup)
โข 3/6 aligned: Moderate alignment (acceptable)
โข 2/6 aligned: Weak alignment (caution)
โข 1/6 aligned: Very weak (likely counter-trend)
Higher confluence typically correlates with longer, stronger trends. However, MTF analysis is optional - you can disable it and rely solely on quality scoring.
Q: Is this suitable for beginners?
A: Yes, but requires foundational knowledge:
You should understand:
โข Basic trend-following concepts (higher highs, higher lows)
โข Risk management principles (position sizing, stop losses)
โข How to read candlestick charts
โข What volume and volatility mean
Beginner-friendly features:
โข Auto preset mode (zero configuration)
โข Quality scoring (tells you signal strength)
โข Dashboard tooltips (hover for explanations)
โข duration analysis boxes (visual profit targets)
Recommended for beginners:
1. Start with "Auto" or "Swing Trading" preset on Daily chart
2. Use Standard Analysis Mode (not Advanced)
3. Set minimum quality to 60 (fewer but better signals)
4. Paper trade first for 2-4 weeks
5. Study methodology references (Minervini, O'Neil, Zanger)
Q: What is the Asset Type setting and why does it matter?
A: Asset Type (in Advanced analysis mode) adjusts duration estimates based on volatility characteristics:
โข Small Cap: Explosive moves, extended trends (+30-40%)
โข Biotech / Speculative: Parabolic potential, news-driven (+40%)
โข Blue Chip / Large Cap: Baseline, steady trends (0% adjustment)
โข Tech Growth: Momentum-driven, longer trends (+20%)
โข Dividend / Value: Slower, grinding trends (-20%)
โข Cyclical: Macro-driven, variable (ยฑ10%)
โข Crypto / High Volatility: Parabolic potential (+30%)
Correct configuration improves Statistical accuracy by 15-20%. Using Blue Chip settings on a biotech stock may underestimate trend length (you'll exit too early).
Q: Can I backtest this indicator?
A: Yes! TradingView's Strategy Tester works with this indicator's signals.
To backtest:
1. Note the entry conditions (SuperTrend flip + quality threshold + filters)
2. Create a strategy script using same logic
3. Run Strategy Tester on historical data
Additionally, the indicator includes BUILT-IN duration estimate validation:
โข System backtests its own duration estimates
โข Shows accuracy metrics in dashboard and duration analysis boxes
โข Helps assess reliability on your specific symbol/timeframe
Q: Why does Volume Momentum auto-disable in Scalping mode?
A: Scalping requires ultra-fast entries to catch quick moves. Volume Momentum filter adds friction by requiring volume confirmation before signaling, which can cause missed opportunities in rapid scalping.
Scalping preset is optimized for speed and frequency - the filter is counterproductive for that style. It remains enabled for Day Trading, Swing Trading, and Position Trading presets where patience improves results.
You can manually enable it in Custom mode if desired.
Q: How much historical data do I need for accurate duration estimates?
A:
Minimum: 50-100 bars (indicator will function but duration estimates less reliable)
Recommended: 500+ bars (robust statistical database)
Optimal: 1000+ bars (maximum Statistical accuracy)
More history = more completed trends = better pattern matching = more accurate duration estimates.
New symbols or newly-switched timeframes will have lower Statistical accuracy initially. Allow 2-4 weeks for the system to build historical database.
IMPORTANT DISCLAIMERS
No Guarantee of Profit:
This indicator is an educational tool and does not guarantee any specific trading results. All trading involves substantial risk of loss. Duration estimates are statistical calculations based on historical patterns and are not guarantees of future performance.
Past Performance:
Historical backtest results and Statistical accuracy statistics do not guarantee future performance. Market conditions change constantly. What worked historically may not work in current or future markets.
Not Financial Advice:
This indicator provides technical analysis signals and statistical duration estimates only. It is not financial, investment, or trading advice. Always consult with a qualified financial advisor before making investment decisions.
Risk Warning:
Trading stocks, options, futures, forex, and cryptocurrencies involves significant risk. You can lose all of your invested capital. Never trade with money you cannot afford to lose. Only risk capital you can lose without affecting your lifestyle.
Testing Required:
Always test this indicator on a demo account or with paper trading before risking real capital. Understand how it works in different market conditions. Verify Statistical accuracy on your specific instruments and timeframes before trusting it with real money.
User Responsibility:
You are solely responsible for your trading decisions. The developer assumes no liability for trading losses, incorrect duration estimates, software errors, or any other damages incurred while using this indicator.
Statistical Estimation Limitations:
Trend Duration estimates are statistical estimates based on historical pattern matching. They are NOT guarantees. Actual trend durations may differ significantly from duration estimates due to unforeseen news events, market regime changes, or lack of historical precedent for current conditions.
CREDITS & ACKNOWLEDGMENTS
Methodology Inspiration:
โข Mark Minervini - Volatility Contraction Pattern (VCP) concepts and pullback entry techniques
โข William O'Neil - Volume analysis principles and CANSLIM institutional buying patterns
โข Dan Zanger - Momentum breakout strategies and volatility expansion entries
Technical Components:
โข SuperTrend calculation - Classic ATR-based trend indicator (public domain)
โข Statistical analysis - Standard median, average, range calculations
โข k-Nearest Neighbors - Classic machine learning similarity matching concept
โข Multi-timeframe analysis - Standard request.security implementation in Pine Script
For questions, feedback, or support, please comment below or send a private message.
Happy Trading!
STRATEGY 1 โ Red Dragon โ Model 1 โ [Titans_Invest]The Red Dragon Model 1 is a fully automated trading strategy designed to operate BTC/USDT.P on the 4-hour chart with precision, stability, and consistency. It was built to deliver reliable behavior even during strong market movements, maintaining operational discipline and avoiding abrupt variations that could interfere with the traderโs decision-making.
Its core is based on a professionally engineered logical structure that combines trend filters, confirmation criteria, and balanced risk management. Every component was designed to work in an integrated way, eliminating noise, avoiding unnecessary trades, and protecting capital in critical moments. There are no secret mechanisms or hidden logic: everything is built to be objective, clean, and efficient.
Even though it is based on professional quantitative engineering, Red Dragon Model 1 remains extremely simple to operate. All logic is clearly displayed and fully accessible within TradingView itself, making it easy to understand for both beginners and experienced traders. The structure is organized so that any user can quickly view entry conditions, exit criteria, additional filters, adjustable parameters, and the full mechanics behind the strategyโs behavior.
In addition, the architecture was built to minimize unnecessary complexity. Parameters are straightforward, intuitive, and operate in a balanced way without requiring deep adjustments or advanced knowledge. Traders have full freedom to analyze the strategy, understand the logic, and make personal adaptations if desiredโalways with total transparency inside TradingView.
The strategy was also designed to deliver consistent operational behavior over the long term. Its confirmation criteria reduce impulsive trades; its filters isolate noise; and its overall logic prioritizes high-quality entries in structured market movements. The goal is to provide a stable, clear, and repeatable flowโessential characteristics for any medium-term quantitative approach.
Combining clarity, professional structure, and ease of use, Red Dragon Model 1 offers a solid foundation both for users who want a ready-to-use automated strategy and for those looking to study quantitative models in greater depth.
This entire project was built with extreme dedication, backed by more than 14,000 hours of hands-on experience in Pine Script, continuously refining patterns, techniques, and structures until reaching its current level of maturity. Every line of code reflects this long process of improvement, resulting in a strategy that unites professional engineering, transparency, accessibility, and reliable execution.
๐ถ MAIN FEATURES
โข Fully automated and robust: Operates without manual intervention, ideal for traders seeking consistency and stability. It delivers reliable performance even in volatile markets thanks to the solid quantitative engineering behind the system.
โข Multiple layers of confirmation: Combines 10 key technical indicators with 15 adaptive filters to avoid false signals. It only triggers entries when all trend, market strength, and contextual criteria align.
โข Configurable and adaptable filters: Each of the 15 filters can be enabled, disabled, or adjusted by the user, allowing the creation of personalized statistical models for different assets and timeframes. This flexibility gives full freedom to optimize the strategy according to individual preferences.
โข Clear and accessible logic: All entry and exit conditions are explicitly shown within the TradingView parameters. The strategy has no hidden componentsโany user can quickly analyze and understand each part of the system.
โข Integrated exclusive tools: Includes complete backtest tables (desktop and mobile versions) with annualized statistics, along with real-time entry conditions displayed directly on the chart. These tools help monitor the strategy across devices and track performance and risk metrics.
โข No repaint: All signals are static and do not change after being plotted. This ensures the trader can trust every entry shown without worrying about indicators rewriting past values.
๐ท ENTRY CONDITIONS & RISK MANAGEMENT
Red Dragon Model 1 triggers buy (long) or sell (short) signals only when all configured conditions are satisfied. For example:
โข Volume:
โข The system only trades when current volume exceeds the volume moving average multiplied by a user-defined factor, indicating meaningful market participation.
โข RSI:
โข Confirms bullish bias when RSI crosses above its moving average, and bearish bias when crossing below.
โข ADX:
โข Enters long when +DI is above โDI with ADX above a defined threshold, indicating directional strength to the upside (and the opposite conditions for shorts).
โข Other indicators (MACD, SAR, Ichimoku, Support/Resistance, etc.)
Each one must confirm the expected direction before a final signal is allowed.
When all bullish criteria are met simultaneously, the system enters Long; when all criteria indicate a bearish environment, the system enters Short.
In addition, the strategy uses fixed Take Profit and Stop Loss targets for risk control:
Currently: TP around 1.5% and SL around 2.0% per trade, ensuring consistent and transparent risk management on every position.
โ๏ธ INDICATORS
__________________________________________________________
ย ย 1) ๐ Volume: Avoids trading on flat charts.
ย ย 2) ๐ MACD: Tracks momentum through moving averages.
ย ย 3) ๐งฒ RSI: Indicates overbought or oversold conditions.
ย ย 4) ๐
ฐ๏ธ ADX: Measures trend strength and potential entry points.
ย ย 5) ๐ฅ SAR: Identifies changes in price direction.
ย ย 6) โ๏ธ Cloud: Accurately detects changes in market trends.
ย ย 7) ๐ก๏ธ R/F: Improves trend visualization and helps avoid pitfalls.
ย ย 8) ๐ S/R: Fixed support and resistance levels.
ย ย 9)โญโฏMA: Moving Averages.
10) ๐ฎ LR: Forecasting using Linear Regression.
__________________________________________________________
๐ข ENTRY CONDITIONS ๐ด
__________________________________________________________
IF all conditions are ๐ข = ๐ Long
IF all conditions are ๐ด = ๐ Short
__________________________________________________________
๐จ CURRENT TRIGGER SIGNAL ๐จ
__________________________________________________________
๐ Volume
๐ข LONG ย = (volume) > (MA_volume) * (Volume Mult)
๐ด SHORT = (volume) > (MA_volume) * (Volume Mult)
๐งฒ RSI
๐ข LONG ย = (RSI) > (RSI_MA)
๐ด SHORT = (RSI) < (RSI_MA)
๐ข ALL ENTRY CONDITIONS AVAILABLE ๐ด
__________________________________________________________
๐ Volume
๐ข LONGย ย = (volume) > (MA_volume) * (Volume Mult)
๐ด SHORT = (volume) > (MA_volume) * (Volume Mult)
๐ Volume
๐ข LONGย ย = (volume) > (MA_volume) * (Volume Mult) and (close) > (open)
๐ด SHORT = (volume) > (MA_volume) * (Volume Mult) and (close) < (open)
๐ MACD
๐ข LONGย ย = (MACD) > (Signal Smoothing)
๐ด SHORT = (MACD) < (Signal Smoothing)
๐งฒ RSI
๐ข LONGย ย = (RSI) < (Upper)
๐ด SHORT = (RSI) > (Lower)
๐งฒ RSI
๐ข LONGย ย = (RSI) > (RSI_MA)
๐ด SHORT = (RSI) < (RSI_MA)
๐
ฐ๏ธ ADX
๐ข LONGย ย = (+DI) > (-DI) and (ADX) > (Treshold)
๐ด SHORT = (+DI) < (-DI) and (ADX) > (Treshold)
๐ฅ SAR
๐ข LONGย ย = (close) > (SAR)
๐ด SHORT = (close) < (SAR)
โ๏ธ Cloud
๐ข LONGย ย = (Cloud A) > (Cloud B)
๐ด SHORT = (Cloud A) < (Cloud B)
โ๏ธ Cloud
๐ข LONGย ย = (Kama) > (Kama )
๐ด SHORT = (Kama) < (Kama )
๐ก๏ธ R/F
๐ข LONGย ย = (high) > (UP Range) ย ย ย ย ย and (upward) ย ย ย ย > (0)
๐ด SHORT = (low)ย < (DOWN Range) and (downward) > (0)
๐ก๏ธ R/F
๐ข LONGย ย = (high) > (UP Range)
๐ด SHORT = (low)ย < (DOWN Range)
๐ S/R
๐ข LONGย ย = (close) > (Resistance)
๐ด SHORT = (close) < (Support)
โญโฏMA2๏ธโฃ
๐ข LONGย ย = (Cyan Bar MA2๏ธโฃ)
๐ด SHORT = (Red Bar MA2๏ธโฃ)
โญโฏMA2๏ธโฃ
๐ข LONGย ย = (close) > (MA2๏ธโฃ)
๐ด SHORT = (close) < (MA2๏ธโฃ)
โญโฏMA2๏ธโฃ
๐ข LONGย ย = (Positive MA2๏ธโฃ)
๐ด SHORT = (Negative MA2๏ธโฃ)
__________________________________________________________
๐ฏ TP / SL ๐
__________________________________________________________
๐ฏ TP: 1.5 ๏ผ
๐ SL:ย 2.0 ๏ผ
__________________________________________________________
๐ช UNIQUE FEATURES OF THIS STRATEGY
____________________________________
1) ย ๐ ย Table Backtest for Mobile.
2) ย ๐ ย Table Backtest for Computer.
3) ย ๐ ย Table Backtest for Computer & Annual Performance.
4) ย ๐ ย Live Entry Conditions.
1) ย ๐ ย Table Backtest for Mobile.
2) ย ๐ ย Table Backtest for Computer.
3) ย ๐ ย Table Backtest for Computer & Annual Performance.
4) ย ๐ ย Live Entry Conditions.
_____________________________
๐ ย BACKTEST / PERFORMANCE ๐
_____________________________
โข Net Profit: +634.47%, Maximum Drawdown: -18.44%.
๐ช PAIR / TIMEFRAME โณ
๐ช PAIR: BINANCE:BTCUSDT.P
โณ TIME: 4 hours (240m)
โ
ON โ๏ธ OFF
โ
LONG
โ
SHORT
๐ฏ TP / SL ๐
๐ฏ TP:ย 1.5ย (๏ผ
)
๐ SL:ย ย 2.0ย (๏ผ
)
โ๏ธ CAPITAL MANAGEMENT
๐ธ Initial Capital: 10000 $ย (TradingView)
๐ฒ Order Size: ย ย ย ย ย 10 ๏ผ
ย ย ย ย ย (Of Equity)
๐ Leverage: ย ย ย ย ย ย ย 10 xย ย ย ย ย ย ย (Exchange)
๐ฉ Commission: ย ย ย 0.03 ๏ผ
ย ย (Exchange)
๐ BACKTEST
๐๏ธ Start: Setember 24, 2019
๐๏ธ End: ย ย November 21, 2025
๐๏ธ Days:ย ย 2250
๐๏ธ Yers:ย ย ย 6.17
๐๏ธ Bars:ย ย 13502
๐ PERFORMANCE
๐ฒ Net Profit:ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย + 63446.89 $
๐ข Net Profit:ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย + 634.47 ๏ผ
๐ฒ DrawDown Maximum: - 10727.48 $
๐ด DrawDown Maximum: - 18.44 ๏ผ
๐ข Total Closed Trades:ย ย ย ย ย 1042
๐ก Percent Profitable:ย ย ย ย ย ย ย 63.92 ๏ผ
๐ก Profit Factor:ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย 1.247
๐ฒ Avg Trade:ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย + 60.89 $
โฑ๏ธ Avg # Bars in Trades
๐ฏ๏ธ Avg # Bars: 4
โณ Avg # Hrs: ย 15
โ๏ธ Trades Winning: 666
โ Trades Losing: ย ย ย 376
โ๏ธ Maximum Consecutive Wins: ย ย 11
โ Maximum Consecutive Losses: 7
๐บ Live Performance : br.tradingview.com
โข Use this strategy on the recommended pair and timeframe above to replicate the tested results.
โข Feel free to experiment and explore other settings, assets, and timeframes.
NeuraEdge ORB Professional Opening Range Breakout Indicator-15m๐ NeuraEdge ORB - Professional Opening Range Breakout Indicator
We're excited to release this clean, effective Opening Range Breakout (ORB) indicator for the trading community. The 15-minute ORB is one of the most time-tested intraday strategies, and we've built this tool to make it simple and actionable.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ WHAT IS THE 15-MINUTE ORB STRATEGY?
The Opening Range Breakout strategy captures the initial price range established in the first 15 minutes of market open (9:30-9:45 AM ET). This range often sets the tone for the trading day, as institutional order flow and overnight gap reactions play out during this window.
The concept is simple:
- Mark the HIGH and LOW of the first 15 minutes
- Trade the breakout when price breaks above or below this range
- Use the opposite side of the range as your stop loss
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ๏ธ HOW TO USE THIS INDICATOR
1๏ธโฃ SETUP
โข Apply to SPY, QQQ, IWM, or any liquid stock/ETF
โข Recommended timeframes: 1-minute or 5-minute charts
โข The indicator automatically detects the 9:30-9:45 AM ET session
2๏ธโฃ WAIT FOR THE RANGE
โข A blue box will form showing the Opening Range
โข Wait for the 15-minute period to complete (marked "โ
COMPLETE" in dashboard)
โข Note the range size - larger ranges often mean stronger moves
3๏ธโฃ TRADE THE BREAKOUT
โข ๐ข LONG: When price closes above the Opening Range High
โข ๐ด SHORT: When price closes below the Opening Range Low
โข Signals appear automatically with entry, stop loss (SL), and take profit (TP) levels
4๏ธโฃ MANAGE YOUR TRADE
โข Stop Loss: Placed at opposite side of range (default) or midpoint
โข Take Profit: Based on your selected Risk:Reward ratio
โข The indicator tracks win rate automatically
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฏ ENTRY TYPES
BREAKOUT MODE (Default)
- Enters immediately when price breaks the range
- More signals, catches the initial move
- Best for: Trending days, high momentum
RETEST MODE
- Waits for price to break out, then pull back to the range
- Fewer signals, better entry price
- Best for: Choppy days, tighter stops
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ SETTINGS EXPLAINED
Display Settings:
- Show Signals - Toggle buy/sell signals
- Show Opening Range Box - Visual box around the 15-min range
- Show Dashboard - Information panel with status and stats
Opening Range Settings:
- Opening Range Minutes - Default 15, adjustable 5-60
- Stop Trading After - Prevents late-day trades (default 3PM ET)
Entry Settings:
- Entry Type - Breakout or Retest
- Require Volume Confirmation - Only signals on above-average volume
- Require FVG Confluence - Adds Fair Value Gap filter for extra confirmation
Risk Management:
- Stop Loss Placement - Opposite Side / Midpoint / ATR Based
- Risk:Reward Ratio - Set your target (1.5 recommended)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ก TIPS FOR BEST RESULTS
โ
DO:
- Trade liquid instruments (SPY, QQQ, major stocks)
- Use 1-5 minute charts for better entry precision
- Respect the stop loss - the range defines your risk
- Pay attention to range size (0.5-1.5x ATR is ideal)
- Be patient - only 1-2 setups per day
โ AVOID:
- Trading both directions on the same day
- Taking trades after 2-3 PM ET
- Very small ranges (likely to get chopped out)
- Low volume breakouts (often fail)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ DASHBOARD INFORMATION
The dashboard shows:
- OR Status - Forming / Complete / Waiting
- OR High/Low - The range levels
- Range Size - In points and ATR multiples
- Breakout Direction - Long / Short / None
- Volume Status - High or Normal
- Win Rate - Tracked automatically
- W/L Record - Wins and losses count
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ ALERTS INCLUDED
- Opening Range Complete - Notifies when the 15-min range is set
- ORB Long Signal - Buy signal triggered
- ORB Short Signal - Sell signal triggered
- Breakout Up/Down - Range broken (even without signal)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๏ธ DISCLAIMER
This indicator is for educational and informational purposes only. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose. This is not financial advice.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
We hope you find this indicator valuable in your trading journey!
๐ฌ Questions or feedback? Leave a comment below.
๐ Check out our full Indicator Suite: www.neura-edge.com
๐ง Support: support@neura-edge.com
Happy Trading!
Algorithm Predator - ML-liteAlgorithm Predator - ML-lite
This indicator combines four specialized trading agents with an adaptive multi-armed bandit selection system to identify high-probability trade setups. It is designed for swing and intraday traders who want systematic signal generation based on institutional order flow patterns , momentum exhaustion , liquidity dynamics , and statistical mean reversion .
Core Architecture
Why These Components Are Combined:
The script addresses a fundamental challenge in algorithmic trading: no single detection method works consistently across all market conditions. By deploying four independent agents and using reinforcement learning algorithms to select or blend their outputs, the system adapts to changing market regimes without manual intervention.
The Four Trading Agents
1. Spoofing Detector Agent ๐ญ
Detects iceberg orders through persistent volume at similar price levels over 5 bars
Identifies spoofing patterns via asymmetric wick analysis (wicks exceeding 60% of bar range with volume >1.8ร average)
Monitors order clustering using simplified Hawkes process intensity tracking (exponential decay model)
Signal Logic: Contrarianโfades false breakouts caused by institutional manipulation
Best Markets: Consolidations, institutional trading windows, low-liquidity hours
2. Exhaustion Detector Agent โก
Calculates RSI divergence between price movement and momentum indicator over 5-bar window
Detects VWAP exhaustion (price at 2ฯ bands with declining volume)
Uses VPIN reversals (volume-based toxic flow dissipation) to identify momentum failure
Signal Logic: Counter-trendโenters when momentum extreme shows weakness
Best Markets: Trending markets reaching climax points, over-extended moves
3. Liquidity Void Detector Agent ๐ง
Measures Bollinger Band squeeze (width <60% of 50-period average)
Identifies stop hunts via 20-bar high/low penetration with immediate reversal and volume spike
Detects hidden liquidity absorption (volume >2ร average with range <0.3ร ATR)
Signal Logic: Breakout anticipationโenters after liquidity grab but before main move
Best Markets: Range-bound pre-breakout, volatility compression zones
4. Mean Reversion Agent ๐
Calculates price z-scores relative to 50-period SMA and standard deviation (triggers at ยฑ2ฯ)
Implements Ornstein-Uhlenbeck process scoring (mean-reverting stochastic model)
Uses entropy analysis to detect algorithmic trading patterns (low entropy <0.25 = high predictability)
Signal Logic: Statistical reversionโenters when price deviates significantly from statistical equilibrium
Best Markets: Range-bound, low-volatility, algorithmically-dominated instruments
Adaptive Selection: Multi-Armed Bandit System
The script implements four reinforcement learning algorithms to dynamically select or blend agents based on performance:
Thompson Sampling (Default - Recommended):
Uses Bayesian inference with beta distributions (tracks alpha/beta parameters per agent)
Balances exploration (trying underused agents) vs. exploitation (using proven winners)
Each agent's win/loss history informs its selection probability
Lite Approximation: Uses pseudo-random sampling from price/volume noise instead of true random number generation
UCB1 (Upper Confidence Bound):
Calculates confidence intervals using: average_reward + sqrt(2 ร ln(total_pulls) / agent_pulls)
Deterministic algorithm favoring agents with high uncertainty (potential upside)
More conservative than Thompson Sampling
Epsilon-Greedy:
Exploits best-performing agent (1-ฮต)% of the time
Explores randomly ฮต% of the time (default 10%, configurable 1-50%)
Simple, transparent, easily tuned via epsilon parameter
Gradient Bandit:
Uses softmax probability distribution over agent preference weights
Updates weights via gradient ascent based on rewards
Best for Blend mode where all agents contribute
Selection Modes:
Switch Mode: Uses only the selected agent's signal (clean, decisive)
Blend Mode: Combines all agents using exponentially weighted confidence scores controlled by temperature parameter (smooth, diversified)
Lock Agent Feature:
Optional manual override to force one specific agent
Useful after identifying which agent dominates your specific instrument
Only applies in Switch mode
Four choices: Spoofing Detector, Exhaustion Detector, Liquidity Void, Mean Reversion
Memory System
Dual-Layer Architecture:
Short-Term Memory: Stores last 20 trade outcomes per agent (configurable 10-50)
Long-Term Memory: Stores episode averages when short-term reaches transfer threshold (configurable 5-20 bars)
Memory Boost Mechanism: Recent performance modulates agent scores by up to ยฑ20%
Episode Transfer: When an agent accumulates sufficient results, averages are condensed into long-term storage
Persistence: Manual restoration of learned parameters via input fields (alpha, beta, weights, microstructure thresholds)
How Memory Works:
Agent generates signal โ outcome tracked after 8 bars (performance horizon)
Result stored in short-term memory (win = 1.0, loss = 0.0)
Short-term average influences agent's future scores (positive feedback loop)
After threshold met (default 10 results), episode averaged into long-term storage
Long-term patterns (weighted 30%) + short-term patterns (weighted 70%) = total memory boost
Market Microstructure Analysis
These advanced metrics quantify institutional order flow dynamics:
Order Flow Toxicity (Simplified VPIN):
Measures buy/sell volume imbalance over 20 bars: |buy_vol - sell_vol| / (buy_vol + sell_vol)
Detects informed trading activity (institutional players with non-public information)
Values >0.4 indicate "toxic flow" (informed traders active)
Lite Approximation: Uses simple open/close heuristic instead of tick-by-tick trade classification
Price Impact Analysis (Simplified Kyle's Lambda):
Measures market impact efficiency: |price_change_10| / sqrt(volume_sum_10)
Low values = large orders with minimal price impact ( stealth accumulation )
High values = retail-dominated moves with high slippage
Lite Approximation: Uses simplified denominator instead of regression-based signed order flow
Market Randomness (Entropy Analysis):
Counts unique price changes over 20 bars / 20
Measures market predictability
High entropy (>0.6) = human-driven, chaotic price action
Low entropy (<0.25) = algorithmic trading dominance (predictable patterns)
Lite Approximation: Simple ratio instead of true Shannon entropy H(X) = -ฮฃ p(x)ยทlogโ(p(x))
Order Clustering (Simplified Hawkes Process):
Tracks self-exciting event intensity (coordinated order activity)
Decays at 0.9ร per bar, spikes +1.0 when volume >1.5ร average
High intensity (>0.7) indicates clustering (potential spoofing/accumulation)
Lite Approximation: Simple exponential decay instead of full ฮป(t) = ฮผ + ฮฃ ฮฑยทexp(-ฮฒ(t-tแตข)) with MLE
Signal Generation Process
Multi-Stage Validation:
Stage 1: Agent Scoring
Each agent calculates internal score based on its detection criteria
Scores must exceed agent-specific threshold (adjusted by sensitivity multiplier)
Agent outputs: Signal direction (+1/-1/0) and Confidence level (0.0-1.0)
Stage 2: Memory Boost
Agent scores multiplied by memory boost factor (0.8-1.2 based on recent performance)
Successful agents get amplified, failing agents get dampened
Stage 3: Bandit Selection/Blending
If Adaptive Mode ON:
Switch: Bandit selects single best agent, uses only its signal
Blend: All agents combined using softmax-weighted confidence scores
If Adaptive Mode OFF:
Traditional consensus voting with confidence-squared weighting
Signal fires when consensus exceeds threshold (default 70%)
Stage 4: Confirmation Filter
Raw signal must repeat for consecutive bars (default 3, configurable 2-4)
Minimum confidence threshold: 0.25 (25%) enforced regardless of mode
Trend alignment check: Long signals require trend_score โฅ -2, Short signals require trend_score โค 2
Stage 5: Cooldown Enforcement
Minimum bars between signals (default 10, configurable 5-15)
Prevents over-trading during choppy conditions
Stage 6: Performance Tracking
After 8 bars (performance horizon), signal outcome evaluated
Win = price moved in signal direction, Loss = price moved against
Results fed back into memory and bandit statistics
Trading Modes (Presets)
Pre-configured parameter sets:
Conservative: 85% consensus, 4 confirmations, 15-bar cooldown
Expected: 60-70% win rate, 3-8 signals/week
Best for: Swing trading, capital preservation, beginners
Balanced: 70% consensus, 3 confirmations, 10-bar cooldown
Expected: 55-65% win rate, 8-15 signals/week
Best for: Day trading, most traders, general use
Aggressive: 60% consensus, 2 confirmations, 5-bar cooldown
Expected: 50-58% win rate, 15-30 signals/week
Best for: Scalping, high-frequency trading, active management
Elite: 75% consensus, 3 confirmations, 12-bar cooldown
Expected: 58-68% win rate, 5-12 signals/week
Best for: Selective trading, high-conviction setups
Adaptive: 65% consensus, 2 confirmations, 8-bar cooldown
Expected: Varies based on learning
Best for: Experienced users leveraging bandit system
How to Use
1. Initial Setup (5 Minutes):
Select Trading Mode matching your style (start with Balanced)
Enable Adaptive Learning (recommended for automatic agent selection)
Choose Thompson Sampling algorithm (best all-around performance)
Keep Microstructure Metrics enabled for liquid instruments (>100k daily volume)
2. Agent Tuning (Optional):
Adjust Agent Sensitivity multipliers (0.5-2.0):
<0.8 = Highly selective (fewer signals, higher quality)
0.9-1.2 = Balanced (recommended starting point)
1.3 = Aggressive (more signals, lower individual quality)
Monitor dashboard for 20-30 signals to identify dominant agent
If one agent consistently outperforms, consider using Lock Agent feature
3. Bandit Configuration (Advanced):
Blend Temperature (0.1-2.0):
0.3 = Sharp decisions (best agent dominates)
0.5 = Balanced (default)
1.0+ = Smooth (equal weighting, democratic)
Memory Decay (0.8-0.99):
0.90 = Fast adaptation (volatile markets)
0.95 = Balanced (most instruments)
0.97+ = Long memory (stable trends)
4. Signal Interpretation:
Green triangle (โฒ): Long signal confirmed
Red triangle (โผ): Short signal confirmed
Dashboard shows:
Active agent (highlighted row with โบ marker)
Win rate per agent (green >60%, yellow 40-60%, red <40%)
Confidence bars (โโโโโ = maximum confidence)
Memory size (short-term buffer count)
Colored zones display:
Entry level (current close)
Stop-loss (1.5ร ATR)
Take-profit 1 (2.0ร ATR)
Take-profit 2 (3.5ร ATR)
5. Risk Management:
Never risk >1-2% per signal (use ATR-based stops)
Signals are entry triggers, not complete strategies
Combine with your own market context analysis
Consider fundamental catalysts and news events
Use "Confirming" status to prepare entries (not to enter early)
6. Memory Persistence (Optional):
After 50-100 trades, check Memory Export Panel
Record displayed alpha/beta/weight values for each agent
Record VPIN and Kyle threshold values
Enable "Restore From Memory" and input saved values to continue learning
Useful when switching timeframes or restarting indicator
Visual Components
On-Chart Elements:
Spectral Layers: EMA8 ยฑ 0.5 ATR bands (dynamic support/resistance, colored by trend)
Energy Radiance: Multi-layer glow boxes at signal points (intensity scales with confidence, configurable 1-5 layers)
Probability Cones: Projected price paths with uncertainty wedges (15-bar projection, width = confidence ร ATR)
Connection Lines: Links sequential signals (solid = same direction continuation, dotted = reversal)
Kill Zones: Risk/reward boxes showing entry, stop-loss, and dual take-profit targets
Signal Markers: Triangle up/down at validated entry points
Dashboard (Configurable Position & Size):
Regime Indicator: 4-level trend classification (Strong Bull/Bear, Weak Bull/Bear)
Mode Status: Shows active system (Adaptive Blend, Locked Agent, or Consensus)
Agent Performance Table: Real-time win%, confidence, and memory stats
Order Flow Metrics: Toxicity and impact indicators (when microstructure enabled)
Signal Status: Current state (Long/Short/Confirming/Waiting) with confirmation progress
Memory Panel (Configurable Position & Size):
Live Parameter Export: Alpha, beta, and weight values per agent
Adaptive Thresholds: Current VPIN sensitivity and Kyle threshold
Save Reminder: Visual indicator if parameters should be recorded
What Makes This Original
This script's originality lies in three key innovations:
1. Genuine Meta-Learning Framework:
Unlike traditional indicator mashups that simply display multiple signals, this implements authentic reinforcement learning (multi-armed bandits) to learn which detection method works best in current conditions. The Thompson Sampling implementation with beta distribution tracking (alpha for successes, beta for failures) is statistically rigorous and adapts continuously. This is not post-hoc optimizationโit's real-time learning.
2. Episodic Memory Architecture with Transfer Learning:
The dual-layer memory system mimics human learning patterns:
Short-term memory captures recent performance (recency bias)
Long-term memory preserves historical patterns (experience)
Automatic transfer mechanism consolidates knowledge
Memory boost creates positive feedback loops (successful strategies become stronger)
This architecture allows the system to adapt without retraining , unlike static ML models that require batch updates.
3. Institutional Microstructure Integration:
Combines retail-focused technical analysis (RSI, Bollinger Bands, VWAP) with institutional-grade microstructure metrics (VPIN, Kyle's Lambda, Hawkes processes) typically found in academic finance literature and professional trading systems, not standard retail platforms. While simplified for Pine Script constraints, these metrics provide insight into informed vs. uninformed trading , a dimension entirely absent from traditional technical analysis.
Mashup Justification:
The four agents are combined specifically for risk diversification across failure modes:
Spoofing Detector: Prevents false breakout losses from manipulation
Exhaustion Detector: Prevents chasing extended trends into reversals
Liquidity Void: Exploits volatility compression (different regime than trending)
Mean Reversion: Provides mathematical anchoring when patterns fail
The bandit system ensures the optimal tool is automatically selected for each market situation, rather than requiring manual interpretation of conflicting signals.
Why "ML-lite"? Simplifications and Approximations
This is the "lite" version due to necessary simplifications for Pine Script execution:
1. Simplified VPIN Calculation:
Academic Implementation: True VPIN uses volume bucketing (fixed-volume bars) and tick-by-tick buy/sell classification via Lee-Ready algorithm or exchange-provided trade direction flags
This Implementation: 20-bar rolling window with simple open/close heuristic (close > open = buy volume)
Impact: May misclassify volume during ranging/choppy markets; works best in directional moves
2. Pseudo-Random Sampling:
Academic Implementation: Thompson Sampling requires true random number generation from beta distributions using inverse transform sampling or acceptance-rejection methods
This Implementation: Deterministic pseudo-randomness derived from price and volume decimal digits: (close ร 100 - floor(close ร 100)) + (volume % 100) / 100
Impact: Not cryptographically random; may have subtle biases in specific price ranges; provides sufficient variation for agent selection
3. Hawkes Process Approximation:
Academic Implementation: Full Hawkes process uses maximum likelihood estimation with exponential kernels: ฮป(t) = ฮผ + ฮฃ ฮฑยทexp(-ฮฒ(t-tแตข)) fitted via iterative optimization
This Implementation: Simple exponential decay (0.9 multiplier) with binary event triggers (volume spike = event)
Impact: Captures self-exciting property but lacks parameter optimization; fixed decay rate may not suit all instruments
4. Kyle's Lambda Simplification:
Academic Implementation: Estimated via regression of price impact on signed order flow over multiple time intervals: ฮp = ฮป ร ฮv + ฮต
This Implementation: Simplified ratio: price_change / sqrt(volume_sum) without proper signed order flow or regression
Impact: Provides directional indicator of impact but not true market depth measurement; no statistical confidence intervals
5. Entropy Calculation:
Academic Implementation: True Shannon entropy requires probability distribution: H(X) = -ฮฃ p(x)ยทlogโ(p(x)) where p(x) is probability of each price change magnitude
This Implementation: Simple ratio of unique price changes to total observations (variety measure)
Impact: Measures diversity but not true information entropy with probability weighting; less sensitive to distribution shape
6. Memory System Constraints:
Full ML Implementation: Neural networks with backpropagation, experience replay buffers (storing state-action-reward tuples), gradient descent optimization, and eligibility traces
This Implementation: Fixed-size array queues with simple averaging; no gradient-based learning, no state representation beyond raw scores
Impact: Cannot learn complex non-linear patterns; limited to linear performance tracking
7. Limited Feature Engineering:
Advanced Implementation: Dozens of engineered features, polynomial interactions (xยฒ, xยณ), dimensionality reduction (PCA, autoencoders), feature selection algorithms
This Implementation: Raw agent scores and basic market metrics (RSI, ATR, volume ratio); minimal transformation
Impact: May miss subtle cross-feature interactions; relies on agent-level intelligence rather than feature combinations
8. Single-Instrument Data:
Full Implementation: Multi-asset correlation analysis (sector ETFs, currency pairs, volatility indices like VIX), lead-lag relationships, risk-on/risk-off regimes
This Implementation: Only OHLCV data from displayed instrument
Impact: Cannot incorporate broader market context; vulnerable to correlated moves across assets
9. Fixed Performance Horizon:
Full Implementation: Adaptive horizon based on trade duration, volatility regime, or profit target achievement
This Implementation: Fixed 8-bar evaluation window
Impact: May evaluate too early in slow markets or too late in fast markets; one-size-fits-all approach
Performance Impact Summary:
These simplifications make the script:
โ
Faster: Executes in milliseconds vs. seconds (or minutes) for full academic implementations
โ
More Accessible: Runs on any TradingView plan without external data feeds, APIs, or compute servers
โ
More Transparent: All calculations visible in Pine Script (no black-box compiled models)
โ
Lower Resource Usage: <500 bars lookback, minimal memory footprint
โ ๏ธ Less Precise: Approximations may reduce statistical edge by 5-15% vs. academic implementations
โ ๏ธ Limited Scope: Cannot capture tick-level dynamics, multi-order-book interactions, or cross-asset flows
โ ๏ธ Fixed Parameters: Some thresholds hardcoded rather than dynamically optimized
When to Upgrade to Full Implementation:
Consider professional Python/C++ versions with institutional data feeds if:
Trading with >$100K capital where precision differences materially impact returns
Operating in microsecond-competitive environments (HFT, market making)
Requiring regulatory-grade audit trails and reproducibility
Backtesting with tick-level precision for strategy validation
Need true real-time adaptation with neural network-based learning
For retail swing/day trading and position management, these approximations provide sufficient signal quality while maintaining usability, transparency, and accessibility. The core logicโmulti-agent detection with adaptive selectionโremains intact.
Technical Notes
All calculations use standard Pine Script built-in functions ( ta.ema, ta.atr, ta.rsi, ta.bb, ta.sma, ta.stdev, ta.vwap )
VPIN and Kyle's Lambda use simplified formulas optimized for OHLCV data (see "Lite" section above)
Thompson Sampling uses pseudo-random noise from price/volume decimal digits for beta distribution sampling
No repainting: All calculations use confirmed bar data (no forward-looking)
Maximum lookback: 500 bars (set via max_bars_back parameter)
Performance evaluation: 8-bar forward-looking window for reward calculation (clearly disclosed)
Confidence threshold: Minimum 0.25 (25%) enforced on all signals
Memory arrays: Dynamic sizing with FIFO queue management
Limitations and Disclaimers
Not Predictive: This indicator identifies patterns in historical data. It cannot predict future price movements with certainty.
Requires Human Judgment: Signals are entry triggers, not complete trading strategies. Must be confirmed with your own analysis, risk management rules, and market context.
Learning Period Required: The adaptive system requires 50-100 bars minimum to build statistically meaningful performance data for bandit algorithms.
Overfitting Risk: Restoring memory parameters from one market regime to a drastically different regime (e.g., low volatility to high volatility) may cause poor initial performance until system re-adapts.
Approximation Limitations: Simplified calculations (see "Lite" section) may underperform academic implementations by 5-15% in highly efficient markets.
No Guarantee of Profit: Past performance, whether backtested or live-traded, does not guarantee future performance. All trading involves risk of loss.
Forward-Looking Bias: Performance evaluation uses 8-bar forward windowโthis creates slight look-ahead for learning (though not for signals). Real-time performance may differ from indicator's internal statistics.
Single-Instrument Limitation: Does not account for correlations with related assets or broader market regime changes.
Recommended Settings
Timeframe: 15-minute to 4-hour charts (sufficient volatility for ATR-based stops; adequate bar volume for learning)
Assets: Liquid instruments with >100k daily volume (forex majors, large-cap stocks, BTC/ETH, major indices)
Not Recommended: Illiquid small-caps, penny stocks, low-volume altcoins (microstructure metrics unreliable)
Complementary Tools: Volume profile, order book depth, market breadth indicators, fundamental catalysts
Position Sizing: Risk no more than 1-2% of capital per signal using ATR-based stop-loss
Signal Filtering: Consider external confluence (support/resistance, trendlines, round numbers, session opens)
Start With: Balanced mode, Thompson Sampling, Blend mode, default agent sensitivities (1.0)
After 30+ Signals: Review agent win rates, consider increasing sensitivity of top performers or locking to dominant agent
Alert Configuration
The script includes built-in alert conditions:
Long Signal: Fires when validated long entry confirmed
Short Signal: Fires when validated short entry confirmed
Alerts fire once per bar (after confirmation requirements met)
Set alert to "Once Per Bar Close" for reliability
Taking you to school. โ Dskyz, Trade with insight. Trade with anticipation.
Range Trading StrategyOVERVIEW
The Range Trading Strategy is a systematic trading approach that identifies price ranges
from higher timeframe candles or trading sessions, tracks pivot points, and generates
trading signals when range extremes are mitigated and confirmed by pivot levels.
CORE CONCEPT
The strategy is based on the principle that when a candle (or session) closes within the
range of the previous candle (or session), that previous candle becomes a "range" with
identifiable high and low extremes. When price breaks through these extremes, it creates
trading opportunities that are confirmed by pivot levels.
RANGE DETECTION MODES
1. HTF (Higher Timeframe) Mode:
Automatically selects a higher timeframe based on the current chart timeframe
Uses request.security() to fetch HTF candle data
Range is created when an HTF candle closes within the previous HTF candle's range
The previous HTF candle's high and low become the range extremes
2. Sessions Mode:
- Divides the trading day into 4 sessions (UTC):
* Session 1: 00:00 - 06:00 (6 hours)
* Session 2: 06:00 - 12:00 (6 hours)
* Session 3: 12:00 - 20:00 (8 hours)
* Session 4: 20:00 - 00:00 (4 hours, spans midnight)
- Tracks high, low, and close for each session
- Range is created when a session closes within the previous session's range
- The previous session's high and low become the range extremes
PIVOT DETECTION
Pivots are detected based on candle color changes (bullish/bearish transitions):
1. Pivot Low:
Created when a bullish candle appears after a bearish candle
Pivot low = minimum of the current candle's low and previous candle's low
The pivot bar is the actual bar where the low was formed (current or previous bar)
2. Pivot High:
Created when a bearish candle appears after a bullish candle
Pivot high = maximum of the current candle's high and previous candle's high
The pivot bar is the actual bar where the high was formed (current or previous bar)
IMPORTANT: There is always only ONE active pivot high and ONE active pivot low at any
given time. When a new pivot is created, it replaces the previous one.
RANGE CREATION
A range is created when:
(HTF Mode) An HTF candle closes within the previous HTF candle's range AND a new HTF
candle has just started
(Sessions Mode) A session closes within the previous session's range AND a new session
has just started
Or Range Can Be Created when the Extreme of Another Range Gets Mitigated and We Have a Pivot low Just Above the Range Low or Pivot High just Below the Range High
Range Properties:
rangeHigh: The high extreme of the range
rangeLow: The low extreme of the range
highStartTime: The timestamp when the range high was actually formed (found by looping
backwards through bars)
lowStartTime: The timestamp when the range low was actually formed (found by looping
backwards through bars)
highMitigated / lowMitigated: Flags tracking whether each extreme has been broken
isSpecial: Flag indicating if this is a "special range" (see Special Ranges section)
RANGE MITIGATION
A range extreme is considered "mitigated" when price interacts with it:
High is mitigated when: high >= rangeHigh (any interaction at or above the level)
Low is mitigated when: low <= rangeLow (any interaction at or below the level)
Mitigation can happen:
At the moment of range creation (if price is already beyond the extreme)
At any point after range creation when price touches the extreme
SIGNAL GENERATION
1. Pending Signals:
When a range extreme is mitigated, a pending signal is created:
a) BEARISH Pending Signal:
- Triggered when: rangeHigh is mitigated
- Confirmation Level: Current pivotLow
- Signal is confirmed when: close < pivotLow
- Stop Loss: Current pivotHigh (at time of confirmation)
- Entry: Short position
Signal Confirmation
b) BULLISH Pending Signal:
- Triggered when: rangeLow is mitigated
- Confirmation Level: Current pivotHigh
- Signal is confirmed when: close > pivotHigh
- Stop Loss: Current pivotLow (at time of confirmation)
- Entry: Long position
IMPORTANT: There is only ever ONE pending bearish signal and ONE pending bullish signal
at any given time. When a new pending signal is created, it replaces the previous one
of the same type.
2. Signal Confirmation:
- Bearish: Confirmed when price closes below the pivot low (confirmation level)
- Bullish: Confirmed when price closes above the pivot high (confirmation level)
- Upon confirmation, a trade is entered immediately
- The confirmation line is drawn from the pivot bar to the confirmation bar
TRADE EXECUTION
When a signal is confirmed:
1. Position Management:
- Any existing position in the opposite direction is closed first
- Then the new position is entered
2. Stop Loss:
- Bearish (Short): Stop at pivotHigh
- Bullish (Long): Stop at pivotLow
3. Take Profit:
- Calculated using Risk:Reward Ratio (default 2:1)
- Risk = Distance from entry to stop loss
- Target = Entry ยฑ (Risk ร R:R Ratio)
- Can be disabled with "Stop Loss Only" toggle
4. Trade Comments:
- "Range Bear" for short trades
- "Range Bull" for long trades
SPECIAL RANGES
Special ranges are created when:
- A range high is mitigated AND the current pivotHigh is below the range high
- A range low is mitigated AND the current pivotLow is above the range low
In these cases:
- The pivot value is stored in an array (storedPivotHighs or storedPivotLows)
- A "special range" is created with only ONE extreme:
* If pivotHigh < rangeHigh: Creates a range with rangeHigh = pivotLow, rangeLow = na
* If pivotLow > rangeLow: Creates a range with rangeLow = pivotHigh, rangeHigh = na
- Special ranges can generate signals just like normal ranges
- If a special range is mitigated on the creation bar or the next bar, it is removed
entirely without generating signals (prevents false signals)
Special Ranges
REVERSE ON STOP LOSS
When enabled, if a stop loss is hit, the strategy automatically opens a trade in the
opposite direction:
1. Long Stop Loss Hit:
- Detects when: position_size > 0 AND position_size <= 0 AND low <= longStopLoss
- Action: Opens a SHORT position
- Stop Loss: Current pivotHigh
- Trade Comment: "Reverse on Stop"
2. Short Stop Loss Hit:
- Detects when: position_size < 0 AND position_size >= 0 AND high >= shortStopLoss
- Action: Opens a LONG position
- Stop Loss: Current pivotLow
- Trade Comment: "Reverse on Stop"
The reverse trade uses the same R:R ratio and respects the "Stop Loss Only" setting.
VISUAL ELEMENTS
1. Range Lines:
- Drawn from the time when the extreme was formed to the mitigation point (or current
time if not mitigated)
- High lines: Blue (or mitigated color if mitigated)
- Low lines: Red (or mitigated color if mitigated)
- Style: SOLID
- Width: 1
2. Confirmation Lines:
- Drawn when a signal is confirmed
- Extends from the pivot bar to the confirmation bar
- Bearish: Red, solid line
- Bullish: Green, solid line
- Width: 1
- Can be toggled on/off
STRATEGY SETTINGS
1. Range Detection Mode:
- HTF: Uses higher timeframe candles
- Sessions: Uses trading session boundaries
2. Auto HTF:
- Automatically selects HTF based on current chart timeframe
- Can be disabled to use manual HTF selection
3. Risk:Reward Ratio:
- Default: 2.0 (2:1)
- Minimum: 0.5
- Step: 0.5
4. Stop Loss Only:
- When enabled: Trades only have stop loss (no take profit)
- Trades close on stop loss or when opposite signal confirms
5. Reverse on Stop Loss:
- When enabled: Hitting a stop loss opens opposite trade with stop at opposing pivot
6. Max Ranges to Display:
- Limits the number of ranges kept in memory
- Oldest ranges are purged when limit is exceeded
KEY FEATURES
1. Dynamic Pivot Tracking:
- Pivots update on every candle color change
- Always maintains one high and one low pivot
2. Range Lifecycle:
- Ranges are created when price closes within previous range
- Ranges are tracked until mitigated
- Mitigation creates pending signals
- Signals are confirmed by pivot levels
3. Signal Priority:
- Only one pending signal of each type at a time
- New signals replace old ones
- Confirmation happens on close of bar
4. Position Management:
- Closes opposite positions before entering new trades
- Tracks stop loss levels for reverse functionality
- Respects pyramiding = 1 (only one position per direction)
5. Time-Based Drawing:
- Uses time coordinates instead of bar indices for line drawing
- Prevents "too far from current bar" errors
- Lines can extend to any historical point
USAGE NOTES
- Best suited for trending and ranging markets
- Works on any timeframe, but HTF mode adapts automatically
- Sessions mode is ideal for intraday trading
- Pivot detection requires clear candle color changes
- Range detection requires price to close within previous range
- Signals are generated on bar close, not intra-bar
The strategy combines range identification, pivot tracking, and signal confirmation to
create a systematic approach to trading breakouts and reversals based on price structure, past performance does not in any way predict future performance
Velocity SmartMoney Engine work - Delta Exchange๐ Velocity SmartMoney Engine
Adaptive Breakout & Order Block Strategy with Dynamic Risk Control
---
๐ Overview
The Velocity SmartMoney Engine is a next-generation trading strategy that fuses Smart Money breakout logic , Order Block structure detection , and Supertrend-based directional filtering into one precision-built system.
It identifies institutional-level breakouts , manages positions with ATR-based adaptive risk , and executes disciplined exits using stop-loss, trailing stop, and profit target logic.
Designed for swing and short-term system traders, this strategy performs excellently on BTC, ETH, NIFTY, BANKNIFTY, Gold, and major FX pairs โ best on 15m to 4h timeframes .
---
โ๏ธ Core Components
1๏ธโฃ Smart Money Breakout Logic
Detects real breakouts using dynamic support/resistance pivots.
Confirms entries only during strong volatility bursts.
Avoids false breakouts in sideways markets.
2๏ธโฃ Order Block Gap Detection
Finds institutional imbalance zones (Smart Money footprints).
Bullish gaps = Long bias; Bearish gaps = Short bias.
Works with candle confirmation and momentum validation.
3๏ธโฃ Supertrend Directional Filter
Trades only in direction of Supertrend bias.
Exits instantly when Supertrend flips.
Prevents entries against dominant trend.
4๏ธโฃ ATR-Based Risk & Volatility Filter
Uses ATR ร multiplier for adaptive stop sizing.
Volatility filter ensures trades trigger only during active markets.
Avoids whipsaw zones.
---
๐ฐ Position Management
Stop-Loss: Adaptive ATR-based.
Take-Profit: Default 5% target (editable input).
Trailing Stop: Auto-adjusts to lock profits.
No-Exit Hold: Hold position for defined candles before exits.
Supertrend Flip Exit: Instant trend-based closure.
---
๐ง Built-In Trade Discipline
One-trade-per-bar guard prevents duplicate entries.
Volatility-weighted breakout validation.
Clean and conflict-free exit hierarchy.
---
๐ฏ Key Features
โ
Smart Money breakout + Order Block fusion
โ
Supertrend-based trend confirmation
โ
ATR dynamic stop + 5% profit target
โ
Adaptive trailing logic
โ
One-trade-per-bar control
โ
Works across Crypto, Indices, FX, Commodities
โ
Ideal for 1hโ4h swing setups
---
๐ Recommended Settings
Parameter | Typical Value | Purpose
--- | --- | ---
Levels Period | 20 | Pivot lookback for S/R zones
Volatility Filter | 20โ40 | Filters out low-momentum areas
ATR Multiplier | 1.5 | Adjust stop size by volatility
Supertrend Length | 10 | ATR period for trend bias
Supertrend Multiplier | 3.0 | Supertrend sensitivity
Target Profit | 5% | Default take-profit level
---
โก Suggested Use
โข Best suited for swing entries on 1H / 4H charts .
โข Combine with session filters or trend confluence for automation.
โข Ideal as a base module for TradingView + Broker integrations .
---
๐งฉ Disclaimer
This script is for educational purposes only .
Past performance does not guarantee future returns.
Use responsibly. The developer assumes no liability for financial losses.
---
๐ฌ Community & Access
Developed by: Shubham Singh
Version: Velocity SmartMoney Engine v1.0
For premium modules & automation: DM "Velocity Access" on chat to request access.
---
ยฉ 2025 Velocity SmartMoney Engine โ All Rights Reserved
VMS Multi Index Options Buying Indicator๐ VMS Multi-Index Options Buying Indicator โ Consolidated Overview
________________________________________
๐ฏ What It Is
A professional-grade options trading system that analyses multiple technical parameters to generate quantified buy signals for call and put options. It includes:
โข Integrated risk management
โข Multi-layered confirmation
โข Quantified strength scores
________________________________________
โก Core Functionality
โข Dual Analysis System: Call and put analysis running simultaneously
โข Multi-Timeframe Analysis: Intraday to swing trading
โข Quantified Scoring: Objective 0โ7 strength scoring system
โข Holistic Market View: Combines technicals, levels, volume, and momentum into a single signal
________________________________________
๐ง Technical Components
1. VMS Core Momentum System
โข VMS SQZM Momentum: Primary oscillator (must be positive for both calls and puts)
โข VMS Index Trends: Short-term and medium-term alignment
โข Strength Scoring: 7-point system evaluating multiple parameters
2. Support/Resistance Levels (L0โL10)
Level Significance Options Trading Application
L00โL02 Strong Support Ideal for CALL BUY entries
L05 Critical Decision Point Wait for confirmation
L08โL9 Strong Resistance Ideal for PUT BUY entries
3. ATR Trend System
โข Green Lines: Bullish momentum (favour calls)
โข Red Lines: Bearish momentum (favour puts)
โข โฒ/โผ Triangles: Primary entry signals
โข +L/+S Signals: Add-to-position opportunities
4. Volume Confirmation
โข Real-time buy/sell volume analysis
โข Cumulative volume trends
โข Bullish/bearish candle counts
โข Net volume direction confirmation
5. Spread Analysis
โข Call-put spread direction and momentum
โข Market sentiment gauge
โข Options flow implications
________________________________________
๐ Signal Generation
Strength-Based Signals
โข STRONG BUY: โฅ4/7 strength points + clear advantage
โข WEAK BUY: 3โ3.9/7 strength points + modest advantage
โข NO TRADE: All other scenarios
Critical Rules
โข Both call and put VMS SQZM must be positive for any trade
โข A clear strength advantage is required over the opposite option
โข Volume confirmation enhances signal reliability
________________________________________
๐งฉ Ideal Trade Setups
Call Buy Setup
if (call_strength >= 4 and
call_strength > put_strength and
val_call > 0 and val_put > 0 and
ATR_trend_green and
price_near_support and
volume_bullish and
spread_positive_expanding):
execute_strong_call_buy()
Put Buy Setup
if (put_strength >= 4 and
put_strength > call_strength and
val_put > 0 and val_call > 0 and
ATR_trend_red and
price_near_resistance and
volume_bearish and
spread_negative_contracting):
execute_strong_put_buy()
________________________________________
๐ Dashboard Interpretation Guide
Section Call Buy Signal Put Buy Signal Critical Check
Spread Positive + Expanding Negative + Contracting Must confirm direction
VMS SQZM Green + Positive Green + Positive Both must be positive
Strength โฅ4 & > Put โฅ4 & > Call Primary decision factor
Squeeze "ON" preferred "ON" preferred Increases probability
Levels Near L00โL02 Near L08โL10 Confluence adds confidence
ATR Green + Rising Red + Falling Trend alignment
Volume Bullish patterns Bearish patterns Must confirm signal
________________________________________
โฐ Timeframe-Specific Strategies
Intraday Trading (5โ15 min)
โข Monitor strength changes every candle
โข Use +L/+S for quick scalp entries
โข Exit before last 30 minutes
โข Tighter stops (50% premium)
Swing Trading (1HโDaily)
โข Require โฅ4.5 strength scores
โข Focus on major level breaks (L00, L05, L10)
โข Use wider stops (60% premium)
โข Hold until the opposite signal generation
________________________________________
๐ก๏ธ Risk Management Integration
โข Automatic position sizing based on signal strength
โข Built-in exit triggers and stop-loss levels
โข Daily trade limits and risk controls
________________________________________
๐ก Unique Value
โข Quantified scoring removes emotional trading
โข Multiple confirmation layers reduce false signals
โข Comprehensive dashboard for quick decision-making
โข Options-specific analysis (not generic indicators)
________________________________________
๐จ Quick Decision Flowchart
1. Start โ Check strength scores
2. Call โฅ4 & > Put? โ Yes โ Check VMS SQZM >0? โ Yes โ โ
Strong Call Buy
3. Put โฅ4 & > Call? โ Yes โ Check VMS SQZM >0? โ Yes โ โ
Strong Put Buy
4. Call โฅ3 & > Put? โ Yes โ โ
Weak Call Buy (reduced size)
5. Put โฅ3 & > Call? โ Yes โ โ
Weak Put Buy (reduced size)
6. โ No Trade โ Wait for better setup
________________________________________
โ ๏ธ Important Note
This is a decision support tool โ not a guaranteed profit system. It requires:
โข Proper risk management
โข Trading experience
โข Integration into a comprehensive trading strategy
Ideal for traders who want a systematic approach, objective signals, options focus, and multiple confirmation layers.
๐ฏ VMS Multi-Index Options Buying Indicator - MASTER CHEAT SHEET
๐ QUICK DECISION MATRIX
๐ข CALL BUY SIGNALS (All Must Align)
Component Strong Signal Weak Signal
Strength โฅ4 & > Put 3-3.9 & > Put
VMS SQZM Both Positive Both Positive
Spread Positive + Expanding Positive
ATR Green + Rising Green
Levels L00-L02 Near Support
Volume Bullish Confirmed Mixed Bullish
Squeeze ON Any
๐ด PUT BUY SIGNALS (All Must Align)
Component Strong Signal Weak Signal
Strength โฅ4 & > Call 3-3.9 & > Call
VMS SQZM Both Positive Both Positive
Spread Negative + Contracting Negative
ATR Red + Falling Red
Levels L08-L10 Near Resistance
Volume Bearish Confirmed Mixed Bearish
Squeeze ON Any
________________________________________
โก INSTANT EXECUTION RULES
โ
STRONG TRADES (High Conviction)
# STRONG CALL BUY
if (call_strength >= 4 and
call_strength > put_strength and
val_call > 0 and val_put > 0):
execute_call_buy()
# STRONG PUT BUY
if (put_strength >= 4 and
put_strength > call_strength and
val_put > 0 and val_call > 0):
execute_put_buy()
๐ก WEAK TRADES (Reduced Size Only)
if strength >= 3 and strength > opposite_strength:
execute_weak_trade() # 30-50% normal size
โ NO TRADE CONDITIONS
if (any_vms_sqzm_negative or
both_strengths >= 3 or
strength < 3 or
no_clear_advantage):
AVOID_TRADE()
________________________________________
๐ฏ CONFIRMATION HIERARCHY
PERFECT CALL SETUP
1. โ
Strength: Call โฅ4, Put < Call
2. โ
VMS SQZM: Both positive
3. โ
Spread: Positive & Expanding
4. โ
ATR: Green + Rising
5. โ
Levels: Near L00-L02 support
6. โ
Volume: Bullish confirmation
7. โ
Squeeze: ON
PERFECT PUT SETUP
1. โ
Strength: Put โฅ4, Call < Put
2. โ
VMS SQZM: Both positive
3. โ
Spread: Negative & Contracting
4. โ
ATR: Red + Falling
5. โ
Levels: Near L08-L10 resistance
6. โ
Volume: Bearish confirmation
7. โ
Squeeze: ON
________________________________________
๐ POSITION MANAGEMENT
๐๏ธ Sizing Matrix
Signal Strength Position Size Stop Loss Profit Target
โฅ4 (STRONG) 70-80% normal 50-60% premium 1:1 R:R + Trail
3-3.9 (WEAK) 30-50% normal 40-50% premium Quick 1:1
<3 (NO TRADE) 0% N/A N/A
๐ช Exit Triggers
โข Stop Loss: 50-60% premium loss OR VMS SQZM turns negative
โข Profit Taking: 50% at 1:1, trail balance using VMS Index
โข Signal Exit: Opposite strength reaches โฅ3 OR current strength drops below entry
________________________________________
โฐ TIMEFRAME STRATEGIES
๐ Intraday (5-15 min)
โข Monitor strength changes every candle
โข Exit before last 30 minutes
โข Tighter stops (50% premium)
โข Use +L/+S for quick scalps
๐
Swing (1H-Daily)
โข Require โฅ4.5 strength scores
โข Focus on major level breaks
โข Wider stops (60% premium)
โข Hold until opposite signal
________________________________________
๐ก๏ธ RISK MANAGEMENT
๐ Daily Limits
โข Max Trades: 3 per day
โข Max Risk: 2% capital per trade
โข Loss Limit: Stop after 2 consecutive losses
โข Portfolio: Never trade both call/put simultaneously
๐ง Psychological Rules
1. Wait for clear signals - don't force
2. Respect strength scoring - no overrides
3. Stick to position sizing - no revenge trading
4. Accept "NO TRADE" as valid outcome
________________________________________
๐ QUICK START FLOW
1. CHECK Strength Scores
2. CONFIRM VMS SQZM Both Positive
3. VALIDATE Spread Direction
4. ALIGN ATR Trend
5. CONFIRM Volume & Levels
6. EXECUTE or WAIT
________________________________________
๐ VMS DASHBOARD FLOWCHART
START โ Check Strength Scores
โ
โ YES โ โ YES โ ๐ข STRONG CALL
โ NO โ NO
โ YES โ โ YES โ ๐ด STRONG PUT
โ NO โ NO
โ YES โ ๐ก WEAK CALL (Reduce Size)
โ NO
โ YES โ ๐ก WEAK PUT (Reduce Size)
โ NO
โ NO TRADE - Wait
________________________________________
โ ๏ธ CRITICAL REMINDERS
โข MUST: Both VMS SQZM positive for ANY trade
โข MUST: Clear strength advantage (โฅ0.5 difference)
โข PREFER: Volume confirmation for maximum size
โข AVOID: Trading during news events
โข RESPECT: Daily risk limits
________________________________________
๐ก SUCCESS FORMULA
Patience + Confirmation + Risk Management = Consistent Results
Wait for โฅ4 strength signals with multiple confirmations, always use proper position sizing, and journal every trade.
Happy Trading! ๐
Remember: This system provides probabilities, not guarantees. Always trade with proper risk management and within your financial means.
Opening Range Breakout with Multi-Timeframe Liquidity]โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
OPENING RANGE BREAKOUT WITH MULTI-TIMEFRAME LIQUIDITY
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
A professional Opening Range Breakout (ORB) indicator enhanced with multi-timeframe liquidity detection, trading session visualization, volume analysis, and trend confirmation tools. Designed for intraday trading with comprehensive alert system.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
WHAT THIS INDICATOR DOES
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
This indicator combines multiple trading concepts:
- Opening Range Breakout (ORB) - Customizable time period detection with automatic high/low identification
- Multi-Timeframe Liquidity - HTF (Higher Timeframe) and LTF (Lower Timeframe) key level detection
- Trading Sessions - Tokyo, London, New York, and Sydney session visualization
- Volume Analysis - Volume spike detection and strength measurement
- Multi-Timeframe Confirmation - Trend bias from higher timeframes
- EMA Integration - Trend filter and dynamic support/resistance
- Smart Alerts - Quality-filtered breakout notifications
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
HOW IT WORKS
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
OPENING RANGE BREAKOUT (ORB):
Concept:
The Opening Range is a period at the start of a trading session where price establishes an initial high and low. Breakouts beyond this range often indicate the direction of the day's trend.
Detection Method:
- Default: 15-minute opening range (configurable)
- Custom Range: Set specific session times with timezone support
- Automatically identifies ORH (Opening Range High) and ORL (Opening Range Low)
- Tracks ORB mid-point for reference
Range Establishment:
1. Session starts (or custom time begins)
2. Tracks highest high and lowest low during the period
3. Range confirmed at end of opening period
4. Levels extend throughout the session
Breakout Detection:
- Bullish Breakout: Close above ORH
- Bearish Breakout: Close below ORL
- Mid-point acts as bias indicator
Visual Display:
- Shaded box during range formation
- Horizontal lines for ORH, ORL, and mid-point
- Labels showing level values
- Color-coded fills based on selected method
Fill Color Methods:
1. Session Comparison:
- Green: Current OR mid > Previous OR mid
- Red: Current OR mid < Previous OR mid
- Gray: Equal or first session
- Shows day-over-day momentum
2. Breakout Direction (Recommended):
- Green: Price currently above ORH (bullish breakout)
- Red: Price currently below ORL (bearish breakout)
- Gray: Price inside range (no breakout)
- Real-time breakout status
MULTI-TIMEFRAME LIQUIDITY:
Two-Tier System for comprehensive level identification:
HTF (Higher Timeframe) Key Liquidity:
- Default: 4H timeframe (configurable to Daily, Weekly)
- Identifies major institutional levels
- Uses pivot detection with adjustable parameters
- Suitable for swing highs/lows where large orders rest
LTF (Lower Timeframe) Key Liquidity:
- Default: 1H timeframe (configurable)
- Provides precision entry/exit levels
- Finer granularity for intraday trading
- Captures minor swing points
Calculation Method:
- Pivot high/low detection algorithm
- Configurable left bars (lookback) and right bars (confirmation)
- Timeframe multiplier for accurate multi-timeframe detection
- Automatic level extension
Mitigation System:
- Tracks when levels are swept (broken)
- Configurable mitigation type: Wick or Close-based
- Option to remove or show mitigated levels
- Display limit prevents chart clutter
Asset-Specific Optimization:
The indicator includes quick reference settings for different assets:
- Major Forex (EUR/USD, GBP/USD): Default settings optimal
- Crypto (BTC/ETH): Left=12, Right=4, Display=7
- Gold: HTF=1D, Left=20
TRADING SESSIONS:
Four Major Sessions with Full Customization:
Tokyo Session:
- Default: 04:00-13:00 UTC+4
- Asian trading hours
- Often sets daily range
London Session:
- Default: 11:00-20:00 UTC+4
- Highest liquidity period
- Major institutional activity
New York Session:
- Default: 16:00-01:00 UTC+4
- US market hours
- High-impact news events
Sydney Session:
- Default: 01:00-10:00 UTC+4
- Earliest Asian activity
- Lower volatility
Session Features:
- Shaded background boxes
- Session name labels
- Optional open/close lines
- Session high/low tracking with colored lines
- Each session has independent color settings
- Fully customizable times and timezones
VOLUME ANALYSIS:
Volume-Based Trade Confirmation:
Volume MA:
- Configurable period (default: 20)
- Establishes average volume baseline
- Used for spike detection
Volume Spike Detection:
- Identifies when volume exceeds MA * multiplier
- Default: 1.5x average volume
- Confirms breakout strength
Volume Strength Measurement:
- Calculates current volume as percentage of average
- Shows relative volume intensity
- Used in alert quality filtering
High Volume Bars:
- Identifies bars above 50th percentile
- Additional confirmation layer
- Indicates institutional participation
MULTI-TIMEFRAME CONFIRMATION:
Trend Bias from Higher Timeframes:
HTF 1 (Trend):
- Default: 1H timeframe
- Uses EMA to determine intermediate trend
- Compares current timeframe EMA to HTF EMA
HTF 2 (Bias):
- Default: 4H timeframe
- Uses 50 EMA for longer-term bias
- Confirms overall market direction
Bias Classifications:
- Bullish Bias: HTF close > HTF 50 EMA AND Current EMA > HTF1 EMA
- Bearish Bias: HTF close < HTF 50 EMA AND Current EMA < HTF1 EMA
- Neutral Bias: Mixed signals between timeframes
EMA Stack Analysis:
- Compares EMA alignment across timeframes
- +1: Bullish stack (lower TF EMA > higher TF EMA)
- -1: Bearish stack (lower TF EMA < higher TF EMA)
- 0: Neutral/crossed
Usage:
- Filters false breakouts
- Confirms trend direction
- Improves trade quality
EMA INTEGRATION:
Dynamic EMA for Trend Reference:
Features:
- Configurable period (default: 20)
- Customizable color and width
- Acts as dynamic support/resistance
- Trend filter for ORB trades
Application:
- Above EMA: Favor long breakouts
- Below EMA: Favor short breakouts
- EMA cross: Potential trend change
- Distance from EMA: Momentum gauge
SMART ALERT SYSTEM:
Quality-Filtered Breakout Notifications:
Alert Types:
1. Standard ORB Breakout
2. High Quality ORB Breakout
Quality Criteria:
- Volume Confirmation: Volume > 1.2x average
- MTF Confirmation: Bias aligned with breakout direction
Standard Alert:
- Basic breakout detection
- Price crosses ORH or ORL
- Icon: ๐ (bullish) or ๐ป (bearish)
High Quality Alert:
- Both volume AND MTF confirmed
- Stronger probability setup
- Icon: ๐โญ (bullish) or ๐ปโญ (bearish)
Alert Information Includes:
- Alert quality rating
- Breakout level and current price
- Volume strength percentage (if enabled)
- MTF bias status (if enabled)
- Recommended action
One Alert Per Bar:
- Prevents alert spam
- Uses flag system to track sent alerts
- Resets on new ORB session
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
HOW TO USE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
OPENING RANGE SETUP:
Basic Configuration:
1. Select time period for opening range (default: 15 minutes)
2. Choose fill color method (Breakout Direction recommended)
3. Enable historical data display if needed
Custom Range (Advanced):
1. Enable Custom Range toggle
2. Set specific session time (e.g., 0930-0945)
3. Select appropriate timezone
4. Useful for specific market opens (NYSE, LSE, etc.)
LIQUIDITY LEVELS SETUP:
Quick Configuration by Asset:
- Forex: Use default settings (Left=15, Right=5)
- Crypto: Set Left=12, Right=4, Display=7
- Gold: Set HTF=1D, Left=20
HTF Liquidity:
- Purpose: Major support/resistance levels
- Recommended: 4H for day trading, 1D for swing trading
- Use as profit targets or reversal zones
LTF Liquidity:
- Purpose: Entry/exit refinement
- Recommended: 1H for day trading, 4H for swing trading
- Use for position management
Mitigation Settings:
- Wick-based: More sensitive (default)
- Close-based: More conservative
- Remove or Show mitigated levels based on preference
TRADING SESSIONS SETUP:
Enable/Disable Sessions:
- Master toggle for all sessions
- Individual session controls
- Show/hide session names
Session High/Low Lines:
- Enable to see session extremes
- Each session has custom colors
- Useful for range trading
Customization:
- Adjust session times for your broker
- Set timezone to match your location
- Customize colors for visibility
VOLUME ANALYSIS SETUP:
Enable Volume Analysis:
1. Toggle on Volume Analysis
2. Set MA length (20 recommended)
3. Adjust spike multiplier (1.5 typical)
Usage:
- Confirm breakouts with volume
- Identify climactic moves
- Filter false signals
MULTI-TIMEFRAME SETUP:
HTF Selection:
- HTF 1 (Trend): 1H for day trading, 4H for swing
- HTF 2 (Bias): 4H for day trading, 1D for swing
Interpretation:
- Trade only with bias alignment
- Neutral bias: Be cautious
- Bias changes: Potential reversals
EMA SETUP:
Configuration:
- Period: 20 for responsive, 50 for smoother
- Color: Choose contrasting color
- Width: 1-2 for visibility
Usage:
- Filter trades: Long above, Short below
- Dynamic support/resistance reference
- Trend confirmation
ALERT SETUP:
TradingView Alert Creation:
1. Enable alerts in indicator settings
2. Enable ORB Breakout Alerts
3. Right-click chart โ Add Alert
4. Select this indicator
5. Choose "Any alert() function call"
6. Configure delivery method (mobile, email, webhook)
Alert Filtering:
- All alerts include quality rating
- High Quality alerts = Volume + MTF confirmed
- Standard alerts = Basic breakout only
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
TRADING STRATEGIES
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CLASSIC ORB STRATEGY:
Setup:
1. Wait for opening range to complete
2. Price breaks and closes above ORH or below ORL
3. Volume > average (if enabled)
4. MTF bias aligned (if enabled)
Entry:
- Bullish: Buy on break above ORH
- Bearish: Sell on break below ORL
- Consider retest entries for better risk/reward
Stop Loss:
- Bullish: Below ORL or range mid-point
- Bearish: Above ORH or range mid-point
- Adjust based on volatility
Targets:
- Initial: Range width extension (ORH + range width)
- Secondary: HTF liquidity levels
- Final: Session high/low or major support/resistance
ORB + LIQUIDITY CONFLUENCE:
Enhanced Setup:
1. Opening range established
2. HTF liquidity level near or beyond ORH/ORL
3. Breakout occurs with volume
4. Price targets the liquidity level
Entry:
- Enter on ORB breakout
- Target the HTF liquidity level
- Use LTF liquidity for position management
Management:
- Partial profits at ORB + range width
- Move stop to breakeven at LTF liquidity
- Final exit at HTF liquidity sweep
ORB REJECTION STRATEGY (Counter-Trend):
Setup:
1. Price breaks above ORH or below ORL
2. Weak volume (below average)
3. MTF bias opposite to breakout
4. Price closes back inside range
Entry:
- Failed bullish break: Short below ORH
- Failed bearish break: Long above ORL
Stop Loss:
- Beyond the failed breakout level
- Or beyond session extreme
Target:
- Opposite end of opening range
- Range mid-point for partial profit
SESSION-BASED ORB TRADING:
Tokyo Session:
- Typically narrower ranges
- Good for range trading
- Wait for London open breakout
London Session:
- Highest volume and volatility
- Strong ORB setups
- Major liquidity sweeps common
New York Session:
- Strong trending moves
- News-driven volatility
- Good for momentum trades
Sydney Session:
- Quieter conditions
- Suitable for range strategies
- Sets up Tokyo session
EMA-FILTERED ORB:
Rules:
- Only take bullish breaks if price > EMA
- Only take bearish breaks if price < EMA
- Ignore counter-trend breaks
Benefits:
- Reduces false signals
- Aligns with larger trend
- Improves win rate
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CONFIGURATION GUIDE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
OPENING RANGE SETTINGS:
Time Period:
- 15 min: Standard for most markets
- 30 min: Wider range, fewer breakouts
- 60 min: For slower markets or swing trades
Custom Range:
- Use for specific market opens
- NYSE: 0930-1000 EST
- LSE: 0800-0830 GMT
- Set timezone to match exchange
Historical Display:
- Enable: See all previous session data
- Disable: Cleaner chart, current session only
LIQUIDITY SETTINGS:
Left Bars (5-30):
- Lower: More frequent, sensitive levels
- Higher: Fewer, more significant levels
- Recommended: 15 for most markets
Right Bars (1-25):
- Confirmation period
- Higher: More reliable, less frequent
- Recommended: 5 for balance
Display Limit (1-20):
- Number of active levels shown
- Higher: More context, busier chart
- Recommended: 7 for clarity
Extension Options:
- Short: Levels visible near formation
- Current: Extended to current bar (recommended)
- Max: Extended indefinitely
VOLUME SETTINGS:
MA Length (5-50):
- Shorter: More responsive to spikes
- Longer: Smoother baseline
- Recommended: 20 for balance
Spike Multiplier (1.0-3.0):
- Lower: More sensitive spike detection
- Higher: Only extreme spikes
- Recommended: 1.5 for day trading
MULTI-TIMEFRAME SETTINGS:
HTF 1 (Trend):
- 5m chart: Use 15m or 1H
- 15m chart: Use 1H or 4H
- 1H chart: Use 4H or 1D
HTF 2 (Bias):
- One level higher than HTF 1
- Provides longer-term context
- Don't use same as HTF 1
EMA SETTINGS:
Length:
- 20: Responsive, more signals
- 50: Smoother, stronger filter
- 200: Long-term trend only
Style:
- Choose contrasting color
- Width 1-2 for visibility
- Match your trading style
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
BEST PRACTICES
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Chart Timeframe Selection:
- ORB Trading: Use 5m or 15m charts
- Session Review: Use 1H or 4H charts
- Swing Trading: Use 1H or 4H charts
Quality Over Quantity:
- Wait for high-quality alerts (volume + MTF)
- Avoid trading every breakout
- Focus on confluence setups
Risk Management:
- Position size based on range width
- Wider ranges = smaller positions
- Use stop losses always
- Take partial profits at targets
Market Conditions:
- Best results in trending markets
- Reduce position size in choppy conditions
- Consider session overlaps for volatility
- Avoid trading near major news if inexperienced
Continuous Improvement:
- Track win rate by session
- Note which confluence factors work best
- Adjust settings based on market volatility
- Review performance weekly
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
PERFORMANCE OPTIMIZATION
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
This indicator is optimized with:
- max_bars_back declarations for efficient processing
- Conditional calculations based on enabled features
- Proper memory management for drawing objects
- Minimal recalculation on each bar
Best Practices:
- Disable unused features (sessions, MTF, volume)
- Limit historical display to reduce rendering
- Use appropriate timeframe for your strategy
- Clear old drawing objects periodically
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
EDUCATIONAL DISCLAIMER
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
This indicator combines established trading concepts:
- Opening Range Breakout theory (price action)
- Liquidity level detection (pivot analysis)
- Session-based trading (time-of-day patterns)
- Volume analysis (confirmation technique)
- Multi-timeframe analysis (trend alignment)
All calculations use standard technical analysis methods:
- Pivot high/low detection algorithms
- Moving averages for trend and volume
- Session time filtering
- Timeframe security functions
The indicator identifies potential trading setups but does not predict future price movements. Success requires proper application within a complete trading strategy including risk management, position sizing, and market context.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
USAGE DISCLAIMER
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
This tool is for educational and analytical purposes. Opening Range Breakout trading involves substantial risk. The alert system and quality filters are designed to identify potential setups but do not guarantee profitability. Always conduct independent analysis, use proper risk management, and never risk capital you cannot afford to lose. Past performance does not indicate future results. Trading intraday breakouts requires experience and discipline.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CREDITS & ATTRIBUTION
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ORIGINAL SOURCE:
This indicator builds upon concepts from LuxAlgo's-ORB






















